Java 类org.hibernate.jpa.boot.spi.Bootstrap 实例源码

项目:lightmare    文件:HibernatePersistenceProviderExt.java   
@Override
   @SuppressWarnings("rawtypes")
   protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilderOrNull(String persistenceUnitName,
    Map properties, ClassLoader providedClassLoader) {

EntityManagerFactoryBuilder builder;

LOG.tracef("Attempting to obtain correct EntityManagerFactoryBuilder for persistenceUnitName : %s",
    persistenceUnitName);

final Map integration = wrap(properties);
PersistenceUnitDescriptor persistenceUnit = getPersistenceXmlDescriptor(persistenceUnitName, properties,
    providedClassLoader);
if (persistenceUnit == null) {
    LOG.debug("Found no matching persistence units");
    builder = null;
} else {
    builder = Bootstrap.getEntityManagerFactoryBuilder(persistenceUnit, integration, providedClassLoader);
}

return builder;
   }
项目:lightmare    文件:HibernatePersistenceProviderExt.java   
/**
    * {@inheritDoc}
    * <p/>
    * Improved with transaction and data source swapping properties
    */
   @SuppressWarnings("rawtypes")
   @Override
   public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) {

EntityManagerFactory emf;

LOG.tracef("Starting createContainerEntityManagerFactory : %s", info.getPersistenceUnitName());

PersistenceUnitDescriptor descriptor = getPersistenceUnitDescriptor(info);
emf = Bootstrap.getEntityManagerFactoryBuilder(descriptor, properties).build();

return emf;
   }
项目:lightmare    文件:HibernatePersistenceProviderExt.java   
/**
    * Generates schema from {@link PersistenceUnitInfo} instance
    */
   @SuppressWarnings("rawtypes")
   @Override
   public void generateSchema(PersistenceUnitInfo info, Map map) {
LOG.tracef("Starting generateSchema : PUI.name=%s", info.getPersistenceUnitName());

PersistenceUnitDescriptor descriptor = getPersistenceUnitDescriptor(info);
final EntityManagerFactoryBuilder builder = Bootstrap.getEntityManagerFactoryBuilder(descriptor, map);
builder.generateSchema();
   }
项目:parkingfriends    文件:JHipsterEntityManagerFactoryWrapper.java   
private void build(List<Class> entities) {
    // Add new entities if not exists
    if (entities != null) {
        MutablePersistenceUnitInfo mutablePersistenceUnitInfo = (MutablePersistenceUnitInfo) info;
        for (Class entity : entities) {
            mutablePersistenceUnitInfo.addManagedClassName(entity.getName());
        }
    }
    entityManagerFactory = Bootstrap.getEntityManagerFactoryBuilder(info, properties).build();
}
项目:jipijapa    文件:TwoPhaseBootstrapImpl.java   
public TwoPhaseBootstrapImpl(final PersistenceUnitInfo info, final Map map) {
    entityManagerFactoryBuilder =
                Bootstrap.getEntityManagerFactoryBuilder(info, map);
}