Tabnine Logo
Mappings.addFilterDefinition
Code IndexAdd Tabnine to your IDE (free)

How to use
addFilterDefinition
method
in
org.hibernate.cfg.Mappings

Best Java code snippets using org.hibernate.cfg.Mappings.addFilterDefinition (Showing top 7 results out of 315)

origin: jboss.jboss-embeddable-ejb3/hibernate-all

private static void parseFilterDef(Element element, Mappings mappings) {
  String name = element.attributeValue( "name" );
  log.debug( "Parsing filter-def [" + name + "]" );
  String defaultCondition = element.getTextTrim();
  if ( StringHelper.isEmpty( defaultCondition ) ) {
    defaultCondition = element.attributeValue( "condition" );
  }
  HashMap paramMappings = new HashMap();
  Iterator params = element.elementIterator( "filter-param" );
  while ( params.hasNext() ) {
    final Element param = (Element) params.next();
    final String paramName = param.attributeValue( "name" );
    final String paramType = param.attributeValue( "type" );
    log.debug( "adding filter parameter : " + paramName + " -> " + paramType );
    final Type heuristicType = TypeFactory.heuristicType( paramType );
    log.debug( "parameter heuristic type : " + heuristicType );
    paramMappings.put( paramName, heuristicType );
  }
  log.debug( "Parsed filter-def [" + name + "]" );
  FilterDefinition def = new FilterDefinition( name, defaultCondition, paramMappings );
  mappings.addFilterDefinition( def );
}
origin: hibernate/hibernate

private static void parseFilterDef(Element element, Mappings mappings) {
  String name = element.attributeValue( "name" );
  log.debug( "Parsing filter-def [" + name + "]" );
  FilterDefinition def = new FilterDefinition( name );
  Iterator params = element.elementIterator( "filter-param" );
  while ( params.hasNext() ) {
    final Element param = (Element) params.next();
    final String paramName = param.attributeValue( "name" );
    final String paramType = param.attributeValue( "type" );
    log.debug( "adding filter parameter : " + paramName + " -> " + paramType );
    final Type heuristicType = TypeFactory.heuristicType( paramType );
    log.debug( "parameter heuristic type : " + heuristicType );
    def.addParameterType( paramName, heuristicType );
  }
  String condition = element.getTextTrim();
  if ( StringHelper.isEmpty(condition) ) condition = element.attributeValue( "condition" );
  def.setDefaultFilterCondition(condition);
  log.debug( "Parsed filter-def [" + name + "]" );
  mappings.addFilterDefinition( def );
}
origin: org.hibernate/com.springsource.org.hibernate.core

private static void parseFilterDef(Element element, Mappings mappings) {
  String name = element.attributeValue( "name" );
  LOG.debugf( "Parsing filter-def [%s]", name );
  String defaultCondition = element.getTextTrim();
  if ( StringHelper.isEmpty( defaultCondition ) ) {
    defaultCondition = element.attributeValue( "condition" );
  }
  HashMap paramMappings = new HashMap();
  Iterator params = element.elementIterator( "filter-param" );
  while ( params.hasNext() ) {
    final Element param = (Element) params.next();
    final String paramName = param.attributeValue( "name" );
    final String paramType = param.attributeValue( "type" );
    LOG.debugf( "Adding filter parameter : %s -> %s", paramName, paramType );
    final Type heuristicType = mappings.getTypeResolver().heuristicType( paramType );
    LOG.debugf( "Parameter heuristic type : %s", heuristicType );
    paramMappings.put( paramName, heuristicType );
  }
  LOG.debugf( "Parsed filter-def [%s]", name );
  FilterDefinition def = new FilterDefinition( name, defaultCondition, paramMappings );
  mappings.addFilterDefinition( def );
}
origin: org.hibernate/com.springsource.org.hibernate

private static void parseFilterDef(Element element, Mappings mappings) {
  String name = element.attributeValue( "name" );
  LOG.debugf( "Parsing filter-def [%s]", name );
  String defaultCondition = element.getTextTrim();
  if ( StringHelper.isEmpty( defaultCondition ) ) {
    defaultCondition = element.attributeValue( "condition" );
  }
  HashMap paramMappings = new HashMap();
  Iterator params = element.elementIterator( "filter-param" );
  while ( params.hasNext() ) {
    final Element param = (Element) params.next();
    final String paramName = param.attributeValue( "name" );
    final String paramType = param.attributeValue( "type" );
    LOG.debugf( "Adding filter parameter : %s -> %s", paramName, paramType );
    final Type heuristicType = mappings.getTypeResolver().heuristicType( paramType );
    LOG.debugf( "Parameter heuristic type : %s", heuristicType );
    paramMappings.put( paramName, heuristicType );
  }
  LOG.debugf( "Parsed filter-def [%s]", name );
  FilterDefinition def = new FilterDefinition( name, defaultCondition, paramMappings );
  mappings.addFilterDefinition( def );
}
origin: org.hibernate/com.springsource.org.hibernate.core

private static void bindFilterDef(FilterDef defAnn, Mappings mappings) {
  Map<String, org.hibernate.type.Type> params = new HashMap<String, org.hibernate.type.Type>();
  for ( ParamDef param : defAnn.parameters() ) {
    params.put( param.name(), mappings.getTypeResolver().heuristicType( param.type() ) );
  }
  FilterDefinition def = new FilterDefinition( defAnn.name(), defAnn.defaultCondition(), params );
  LOG.debugf( "Binding filter definition: %s", def.getFilterName() );
  mappings.addFilterDefinition( def );
}
origin: org.hibernate/com.springsource.org.hibernate

private static void bindFilterDef(FilterDef defAnn, Mappings mappings) {
  Map<String, org.hibernate.type.Type> params = new HashMap<String, org.hibernate.type.Type>();
  for ( ParamDef param : defAnn.parameters() ) {
    params.put( param.name(), mappings.getTypeResolver().heuristicType( param.type() ) );
  }
  FilterDefinition def = new FilterDefinition( defAnn.name(), defAnn.defaultCondition(), params );
  LOG.debugf( "Binding filter definition: %s", def.getFilterName() );
  mappings.addFilterDefinition( def );
}
origin: org.grails/grails-datastore-gorm-hibernate-core

String filterCondition = getMultiTenantFilterCondition(sessionFactoryBeanName, entity);
root.addFilter(GormProperties.TENANT_IDENTITY,filterCondition, true, Collections.<String, String>emptyMap(), Collections.<String, String>emptyMap());
mappings.addFilterDefinition(new FilterDefinition(
    GormProperties.TENANT_IDENTITY,
    filterCondition,
org.hibernate.cfgMappingsaddFilterDefinition

Javadoc

Adds a filter definition to this repository.

Popular methods of Mappings

  • addClass
    Add entity mapping metadata.
  • addImport
    Adds an import (HQL entity rename) to the repository.
  • addTable
    Adds table metadata to this repository returning the created metadata instance.
  • getCatalogName
    Returns the currently bound default catalog name.
  • getClass
    Retrieves the entity mapping metadata for the given entity name.
  • getSchemaName
    Returns the currently bound default schema name.
  • addCollection
    Add collection mapping metadata to this repository.
  • addSecondPass
    Adds a second pass.
  • addTableBinding
    Adds a table binding to this repository.
  • getDefaultAccess
    Get the current default property access style.
  • isAutoImport
    Determine whether auto importing of entity names is currently enabled.
  • addDenormalizedTable
    Adds a 'denormalized table' to this repository.
  • isAutoImport,
  • addDenormalizedTable,
  • addTypeDef,
  • addUniquePropertyReference,
  • getObjectNameNormalizer,
  • setAutoImport,
  • addColumnBinding,
  • addPropertyReference,
  • addQuery

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Path (java.nio.file)
  • JOptionPane (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now