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

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

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

origin: org.grails/grails-hibernate

mappings.setAutoImport(m == null || m.getAutoImport());
GrailsDomainBinder.bindClass(domainClass, mappings, sessionFactoryBeanName);
origin: org.grails/grails-hibernate

/**
 * Overrides the default behaviour to including binding of Grails domain classes.
 */
@Override
protected void secondPassCompile() throws MappingException {
  if (configLocked) {
    return;
  }
  // set the class loader to load Groovy classes
  if (grailsApplication != null) {
    Thread.currentThread().setContextClassLoader(grailsApplication.getClassLoader());
  }
  configureDomainBinder(grailsApplication, domainClasses);
  for (GrailsDomainClass domainClass : domainClasses) {
    if (!GrailsHibernateUtil.usesDatasource(domainClass, dataSourceName)) {
      continue;
    }
    final Mappings mappings = super.createMappings();
    Mapping m = GrailsDomainBinder.getMapping(domainClass);
    mappings.setAutoImport(m == null || m.getAutoImport());
    GrailsDomainBinder.bindClass(domainClass, mappings, sessionFactoryBeanName);
  }
  super.secondPassCompile();
  configLocked = true;
}
origin: hibernate/hibernate

private static void extractRootAttributes(Element hmNode, Mappings mappings) {
  Attribute schemaNode = hmNode.attribute( "schema" );
  mappings.setSchemaName( ( schemaNode == null ) ? null : schemaNode.getValue() );
  Attribute catalogNode = hmNode.attribute( "catalog" );
  mappings.setCatalogName( ( catalogNode == null ) ? null : catalogNode.getValue() );
  Attribute dcNode = hmNode.attribute( "default-cascade" );
  mappings.setDefaultCascade( ( dcNode == null ) ? "none" : dcNode.getValue() );
  Attribute daNode = hmNode.attribute( "default-access" );
  mappings.setDefaultAccess( ( daNode == null ) ? "property" : daNode.getValue() );
  Attribute dlNode = hmNode.attribute( "default-lazy" );
  mappings.setDefaultLazy( dlNode == null || dlNode.getValue().equals( "true" ) );
  Attribute aiNode = hmNode.attribute( "auto-import" );
  mappings.setAutoImport( ( aiNode == null ) ? true : "true".equals( aiNode.getValue() ) );
  Attribute packNode = hmNode.attribute( "package" );
  if ( packNode != null ) mappings.setDefaultPackage( packNode.getValue() );
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

private static void extractRootAttributes(Element hmNode, Mappings mappings) {
  Attribute schemaNode = hmNode.attribute( "schema" );
  mappings.setSchemaName( ( schemaNode == null ) ? null : schemaNode.getValue() );
  Attribute catalogNode = hmNode.attribute( "catalog" );
  mappings.setCatalogName( ( catalogNode == null ) ? null : catalogNode.getValue() );
  Attribute dcNode = hmNode.attribute( "default-cascade" );
  mappings.setDefaultCascade( ( dcNode == null ) ? "none" : dcNode.getValue() );
  Attribute daNode = hmNode.attribute( "default-access" );
  mappings.setDefaultAccess( ( daNode == null ) ? "property" : daNode.getValue() );
  Attribute dlNode = hmNode.attribute( "default-lazy" );
  mappings.setDefaultLazy( dlNode == null || dlNode.getValue().equals( "true" ) );
  Attribute aiNode = hmNode.attribute( "auto-import" );
  mappings.setAutoImport( ( aiNode == null ) || "true".equals( aiNode.getValue() ) );
  Attribute packNode = hmNode.attribute( "package" );
  if ( packNode != null ) mappings.setDefaultPackage( packNode.getValue() );
}
origin: org.hibernate/com.springsource.org.hibernate

private static void extractRootAttributes(Element hmNode, Mappings mappings) {
  Attribute schemaNode = hmNode.attribute( "schema" );
  mappings.setSchemaName( ( schemaNode == null ) ? null : schemaNode.getValue() );
  Attribute catalogNode = hmNode.attribute( "catalog" );
  mappings.setCatalogName( ( catalogNode == null ) ? null : catalogNode.getValue() );
  Attribute dcNode = hmNode.attribute( "default-cascade" );
  mappings.setDefaultCascade( ( dcNode == null ) ? "none" : dcNode.getValue() );
  Attribute daNode = hmNode.attribute( "default-access" );
  mappings.setDefaultAccess( ( daNode == null ) ? "property" : daNode.getValue() );
  Attribute dlNode = hmNode.attribute( "default-lazy" );
  mappings.setDefaultLazy( dlNode == null || dlNode.getValue().equals( "true" ) );
  Attribute aiNode = hmNode.attribute( "auto-import" );
  mappings.setAutoImport( ( aiNode == null ) || "true".equals( aiNode.getValue() ) );
  Attribute packNode = hmNode.attribute( "package" );
  if ( packNode != null ) mappings.setDefaultPackage( packNode.getValue() );
}
origin: org.hibernate/com.springsource.org.hibernate.core

private static void extractRootAttributes(Element hmNode, Mappings mappings) {
  Attribute schemaNode = hmNode.attribute( "schema" );
  mappings.setSchemaName( ( schemaNode == null ) ? null : schemaNode.getValue() );
  Attribute catalogNode = hmNode.attribute( "catalog" );
  mappings.setCatalogName( ( catalogNode == null ) ? null : catalogNode.getValue() );
  Attribute dcNode = hmNode.attribute( "default-cascade" );
  mappings.setDefaultCascade( ( dcNode == null ) ? "none" : dcNode.getValue() );
  Attribute daNode = hmNode.attribute( "default-access" );
  mappings.setDefaultAccess( ( daNode == null ) ? "property" : daNode.getValue() );
  Attribute dlNode = hmNode.attribute( "default-lazy" );
  mappings.setDefaultLazy( dlNode == null || dlNode.getValue().equals( "true" ) );
  Attribute aiNode = hmNode.attribute( "auto-import" );
  mappings.setAutoImport( ( aiNode == null ) || "true".equals( aiNode.getValue() ) );
  Attribute packNode = hmNode.attribute( "package" );
  if ( packNode != null ) mappings.setDefaultPackage( packNode.getValue() );
}
org.hibernate.cfgMappingssetAutoImport

Javadoc

Set whether to enable auto importing of entity names.

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,
  • addFilterDefinition,
  • addTypeDef,
  • addUniquePropertyReference,
  • getObjectNameNormalizer,
  • addColumnBinding,
  • addPropertyReference,
  • addQuery

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • getContentResolver (Context)
  • compareTo (BigDecimal)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • String (java.lang)
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 12 Jupyter Notebook extensions
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