}
LOG.info("Found dialect "+dialectName);
internalPersistenceUnitManager.preparePersistenceUnitInfos();
PersistenceUnitInfo persistenceUnitInfo = internalPersistenceUnitManager.obtainDefaultPersistenceUnitInfo();
HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
jpaVendorAdapter.setDatabasePlatform(dialectName);
String enhancedId = connection.getProperties().getProperty("hibernate.enhanced_id", "false");
LOG.info("Found hibernate.enhanced_id" + enhancedId);
Map<String, Object> jpaPropertyMap = jpaVendorAdapter.getJpaPropertyMap();
jpaPropertyMap.put("hibernate.archive.autodetection", "false");
jpaPropertyMap.put("hibernate.id.new_generator_mappings", enhancedId);
if (persistenceUnitInfo instanceof SmartPersistenceUnitInfo) {
((SmartPersistenceUnitInfo) persistenceUnitInfo).setPersistenceProviderPackageName(jpaVendorAdapter.getPersistenceProviderRootPackage());
}
EntityManagerFactoryBuilderImpl builder = (EntityManagerFactoryBuilderImpl) Bootstrap.getEntityManagerFactoryBuilder(persistenceUnitInfo,
jpaPropertyMap);
ServiceRegistry serviceRegistry = builder.buildServiceRegistry();