org.hibernate.cfg.Configuration.secondPassCompile()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.hibernate.cfg.Configuration.secondPassCompile()方法的一些代码示例,展示了Configuration.secondPassCompile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.secondPassCompile()方法的具体详情如下:
包路径:org.hibernate.cfg.Configuration
类名称:Configuration
方法名:secondPassCompile

Configuration.secondPassCompile介绍

暂无

代码示例

代码示例来源:origin: org.hibernate/hibernate-annotations

processSecondPassesOfType( CreateKeySecondPass.class );
processSecondPassesOfType( SecondaryTableSecondPass.class );
super.secondPassCompile();
inSecondPass = false;

代码示例来源:origin: hibernate/hibernate

/**
 * Call this to ensure the mappings are fully compiled/built. Usefull to ensure getting
 * access to all information in the metamodel when calling e.g. getClassMappings().
 */
public void buildMappings() {
  secondPassCompile();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

/**
 * Call this to ensure the mappings are fully compiled/built. Usefull to ensure getting
 * access to all information in the metamodel when calling e.g. getClassMappings().
 */
public void buildMappings() {
  secondPassCompile();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Call this to ensure the mappings are fully compiled/built. Usefull to ensure getting
 * access to all information in the metamodel when calling e.g. getClassMappings().
 */
public void buildMappings() {
  secondPassCompile();
}

代码示例来源:origin: org.beangle.commons/beangle-commons-orm

/**
 * Update persistentclass and collection's schema.
 * 
 * @see #addClass(Class)
 */
@Override
protected void secondPassCompile() throws MappingException {
 super.secondPassCompile();
 configSchema();
 // remove duplicated persistentClass register in classes map.
 // see addClass
 Set<String> hackedEntityNames = CollectUtils.newHashSet();
 for (Map.Entry<String, PersistentClass> entry : classes.entrySet()) {
  if (!entry.getKey().equals(entry.getValue().getEntityName())) hackedEntityNames.add(entry.getKey());
 }
 for (String entityName : hackedEntityNames) {
  classes.remove(entityName);
 }
}

代码示例来源:origin: babyfish-ct/babyfish

@Override
protected void secondPassCompile() throws MappingException {
  super.secondPassCompile();
  replaceBasicTypesJavaTypeDescriptor();
  processPersistentClasses();
}

代码示例来源:origin: hibernate/hibernate

/**
 * Instantiate a new <tt>SessionFactory</tt>, using the properties and
 * mappings in this configuration. The <tt>SessionFactory</tt> will be
 * immutable, so changes made to the <tt>Configuration</tt> after
 * building the <tt>SessionFactory</tt> will not affect it.
 *
 * @return a new factory for <tt>Session</tt>s
 * @see org.hibernate.SessionFactory
 */
public SessionFactory buildSessionFactory() throws HibernateException {
  log.debug( "Preparing to build session factory with filters : " + filterDefinitions );
  secondPassCompile();
  validate();
  Environment.verifyProperties( properties );
  Properties copy = new Properties();
  copy.putAll( properties );
  Settings settings = buildSettings();
  return new SessionFactoryImpl( this, mapping, settings, sessionEventListenerConfig.shallowCopy() );
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

secondPassCompile();

代码示例来源:origin: org.grails/grails-hibernate

super.secondPassCompile();
} finally {
  currentThread.setContextClassLoader(originalContextLoader);

代码示例来源:origin: hibernate/hibernate

secondPassCompile();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

secondPassCompile();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

secondPassCompile();

代码示例来源:origin: hibernate/hibernate

secondPassCompile();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

secondPassCompile();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

secondPassCompile();

代码示例来源: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: org.hibernate/com.springsource.org.hibernate.core

LOG.debugf( "Preparing to build session factory with filters : %s", filterDefinitions );
secondPassCompile();
if ( !metadataSourceQueue.isEmpty() ) {
  LOG.incompleteMappingMetadataCacheProcessing();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

LOG.debugf( "Preparing to build session factory with filters : %s", filterDefinitions );
secondPassCompile();
if ( !metadataSourceQueue.isEmpty() ) {
  LOG.incompleteMappingMetadataCacheProcessing();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public void validateSchema(Dialect dialect, DatabaseMetadata databaseMetadata)throws HibernateException {
  secondPassCompile();
  String defaultCatalog = properties.getProperty( Environment.DEFAULT_CATALOG );
  String defaultSchema = properties.getProperty( Environment.DEFAULT_SCHEMA );
  Iterator iter = getTableMappings();
  while ( iter.hasNext() ) {
    Table table = (Table) iter.next();
    if ( table.isPhysicalTable() ) {
      TableMetadata tableInfo = databaseMetadata.getTableMetadata(
          table.getName(),
          ( table.getSchema() == null ) ? defaultSchema : table.getSchema(),
          ( table.getCatalog() == null ) ? defaultCatalog : table.getCatalog(),
              table.isQuoted());
      if ( tableInfo == null ) {
        throw new HibernateException( "Missing table: " + table.getName() );
      }
      else {
        table.validateColumns( dialect, mapping, tableInfo );
      }
    }
  }
  iter = iterateGenerators( dialect );
  while ( iter.hasNext() ) {
    PersistentIdentifierGenerator generator = (PersistentIdentifierGenerator) iter.next();
    Object key = generator.generatorKey();
    if ( !databaseMetadata.isSequence( key ) && !databaseMetadata.isTable( key ) ) {
      throw new HibernateException( "Missing sequence or table: " + key );
    }
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public void validateSchema(Dialect dialect, DatabaseMetadata databaseMetadata)throws HibernateException {
  secondPassCompile();
  String defaultCatalog = properties.getProperty( Environment.DEFAULT_CATALOG );
  String defaultSchema = properties.getProperty( Environment.DEFAULT_SCHEMA );
  Iterator iter = getTableMappings();
  while ( iter.hasNext() ) {
    Table table = (Table) iter.next();
    if ( table.isPhysicalTable() ) {
      TableMetadata tableInfo = databaseMetadata.getTableMetadata(
          table.getName(),
          ( table.getSchema() == null ) ? defaultSchema : table.getSchema(),
          ( table.getCatalog() == null ) ? defaultCatalog : table.getCatalog(),
              table.isQuoted());
      if ( tableInfo == null ) {
        throw new HibernateException( "Missing table: " + table.getName() );
      }
      else {
        table.validateColumns( dialect, mapping, tableInfo );
      }
    }
  }
  iter = iterateGenerators( dialect );
  while ( iter.hasNext() ) {
    PersistentIdentifierGenerator generator = (PersistentIdentifierGenerator) iter.next();
    Object key = generator.generatorKey();
    if ( !databaseMetadata.isSequence( key ) && !databaseMetadata.isTable( key ) ) {
      throw new HibernateException( "Missing sequence or table: " + key );
    }
  }
}

相关文章

Configuration类方法