org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor Java Examples
The following examples show how to use
org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractTest.java From high-performance-java-persistence with Apache License 2.0 | 6 votes |
protected EntityManagerFactory newEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName()); Map configuration = properties(); Interceptor interceptor = interceptor(); if (interceptor != null) { configuration.put(AvailableSettings.INTERCEPTOR, interceptor); } Integrator integrator = integrator(); if (integrator != null) { configuration.put("hibernate.integrator_provider", (IntegratorProvider) () -> Collections.singletonList(integrator)); } EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration ); return entityManagerFactoryBuilder.build(); }
Example #2
Source File: LongToNumericTypeTest.java From high-performance-java-persistence with Apache License 2.0 | 6 votes |
@Test public void test() { PersistenceUnitInfoImpl persistenceUnitInfo = new PersistenceUnitInfoImpl( LongToNumericTypeTest.class.getName(), Collections.singletonList( Event.class.getName() ), validateProperties() ); Map<String, Object> configuration = new HashMap<>(); EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor( persistenceUnitInfo), configuration ); EntityManagerFactory emf = null; try { emf = entityManagerFactoryBuilder.build(); } finally { if ( emf != null ) { emf.close(); } } }
Example #3
Source File: AbstractTest.java From hibernate-types with Apache License 2.0 | 6 votes |
protected EntityManagerFactory newEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName()); Map<String, Object> configuration = new HashMap<String, Object>(); configuration.put(AvailableSettings.INTERCEPTOR, interceptor()); final Integrator integrator = integrator(); if (integrator != null) { configuration.put( "hibernate.integrator_provider", new IntegratorProvider() { @Override public List<Integrator> getIntegrators() { return Collections.singletonList(integrator); } } ); } EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration ); return entityManagerFactoryBuilder.build(); }
Example #4
Source File: SpringHibernateJpaPersistenceProvider.java From spring-analysis-note with MIT License | 5 votes |
@Override @SuppressWarnings("rawtypes") public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) { final List<String> mergedClassesAndPackages = new ArrayList<>(info.getManagedClassNames()); if (info instanceof SmartPersistenceUnitInfo) { mergedClassesAndPackages.addAll(((SmartPersistenceUnitInfo) info).getManagedPackages()); } return new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(info) { @Override public List<String> getManagedClassNames() { return mergedClassesAndPackages; } }, properties).build(); }
Example #5
Source File: AbstractTest.java From hibernate-master-class with Apache License 2.0 | 5 votes |
protected EntityManagerFactory newEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = new PersistenceUnitInfoImpl( getClass().getSimpleName(), entityClassNames(), getProperties() ); Map<String, Object> configuration = new HashMap<>(); configuration.put(org.hibernate.jpa.AvailableSettings.INTERCEPTOR, interceptor()); EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration ); return entityManagerFactoryBuilder.build(); }
Example #6
Source File: CustomHibernatePersistenceProvider.java From rapidoid with Apache License 2.0 | 5 votes |
public EntityManagerFactory createEMF(Map properties) { PersistenceUnitInfo info = new RapidoidPersistenceUnitInfo(persistenceUnitName, dataSource, classLoader); PersistenceUnitInfoDescriptor infoDescriptor = new PersistenceUnitInfoDescriptor(info); CustomDescriptor customDescriptor = new CustomDescriptor(infoDescriptor, entityTypes); EntityManagerFactoryBuilder builder = getEntityManagerFactoryBuilder(customDescriptor, properties, classLoader); return builder.build(); }
Example #7
Source File: SpringHibernateJpaPersistenceProvider.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Override @SuppressWarnings("rawtypes") public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) { final List<String> mergedClassesAndPackages = new ArrayList<String>(info.getManagedClassNames()); if (info instanceof SmartPersistenceUnitInfo) { mergedClassesAndPackages.addAll(((SmartPersistenceUnitInfo) info).getManagedPackages()); } return new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(info) { @Override public List<String> getManagedClassNames() { return mergedClassesAndPackages; } }, properties).build(); }
Example #8
Source File: AbstractTest.java From hibernate-types with Apache License 2.0 | 5 votes |
protected EntityManagerFactory newEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName()); Map<String, Object> configuration = new HashMap<String, Object>(); EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration ); return entityManagerFactoryBuilder.build(); }
Example #9
Source File: AbstractTest.java From hibernate-types with Apache License 2.0 | 5 votes |
protected EntityManagerFactory newEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName()); Map<String, Object> configuration = new HashMap<>(); configuration.put(AvailableSettings.INTERCEPTOR, interceptor()); Integrator integrator = integrator(); if (integrator != null) { configuration.put("hibernate.integrator_provider", (IntegratorProvider) () -> Collections.singletonList(integrator)); } final List<Type> additionalTypes = additionalTypes(); if (additionalTypes != null) { configuration.put("hibernate.type_contributors", (TypeContributorList) () -> { List<TypeContributor> typeContributors = new ArrayList<>(); for (Type additionalType : additionalTypes) { if (additionalType instanceof BasicType) { typeContributors.add((typeContributions, serviceRegistry) -> typeContributions.contributeType((BasicType) additionalType)); } else if (additionalType instanceof UserType) { typeContributors.add((typeContributions, serviceRegistry) -> typeContributions.contributeType((UserType) additionalType)); } else if (additionalType instanceof CompositeUserType) { typeContributors.add((typeContributions, serviceRegistry) -> typeContributions.contributeType((CompositeUserType) additionalType)); } } return typeContributors; }); } EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration ); return entityManagerFactoryBuilder.build(); }
Example #10
Source File: SpringHibernateJpaPersistenceProvider.java From lams with GNU General Public License v2.0 | 5 votes |
@Override @SuppressWarnings("rawtypes") public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) { final List<String> mergedClassesAndPackages = new ArrayList<String>(info.getManagedClassNames()); if (info instanceof SmartPersistenceUnitInfo) { mergedClassesAndPackages.addAll(((SmartPersistenceUnitInfo) info).getManagedPackages()); } return new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(info) { @Override public List<String> getManagedClassNames() { return mergedClassesAndPackages; } }, properties).build(); }
Example #11
Source File: SpringHibernateJpaPersistenceProvider.java From java-technology-stack with MIT License | 5 votes |
@Override @SuppressWarnings("rawtypes") public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) { final List<String> mergedClassesAndPackages = new ArrayList<>(info.getManagedClassNames()); if (info instanceof SmartPersistenceUnitInfo) { mergedClassesAndPackages.addAll(((SmartPersistenceUnitInfo) info).getManagedPackages()); } return new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(info) { @Override public List<String> getManagedClassNames() { return mergedClassesAndPackages; } }, properties).build(); }
Example #12
Source File: AbstractTest.java From hypersistence-optimizer with Apache License 2.0 | 5 votes |
protected EntityManagerFactory newEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName()); Map<String, Object> configuration = new HashMap<String, Object>(); configuration.put(AvailableSettings.INTERCEPTOR, interceptor()); EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl( new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration ); return entityManagerFactoryBuilder.build(); }
Example #13
Source File: Bootstrap.java From lams with GNU General Public License v2.0 | 4 votes |
public static EntityManagerFactoryBuilder getEntityManagerFactoryBuilder( PersistenceUnitInfo persistenceUnitInfo, Map integration, ClassLoaderService providedClassLoaderService) { return getEntityManagerFactoryBuilder( new PersistenceUnitInfoDescriptor( persistenceUnitInfo ), integration, providedClassLoaderService ); }
Example #14
Source File: Bootstrap.java From lams with GNU General Public License v2.0 | 4 votes |
public static EntityManagerFactoryBuilder getEntityManagerFactoryBuilder( PersistenceUnitInfo persistenceUnitInfo, Map integration, ClassLoader providedClassLoader) { return getEntityManagerFactoryBuilder( new PersistenceUnitInfoDescriptor( persistenceUnitInfo ), integration, providedClassLoader ); }
Example #15
Source File: Bootstrap.java From lams with GNU General Public License v2.0 | 4 votes |
public static EntityManagerFactoryBuilder getEntityManagerFactoryBuilder( PersistenceUnitInfo persistenceUnitInfo, Map integration) { return getEntityManagerFactoryBuilder( new PersistenceUnitInfoDescriptor( persistenceUnitInfo ), integration ); }
Example #16
Source File: DatabaseImpl.java From jweb-cms with GNU Affero General Public License v3.0 | 4 votes |
private EntityManagerFactory createEMF() { PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(); Map<String, Object> configuration = new HashMap<>(); return new EntityManagerFactoryBuilderImpl(new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration).build(); }
Example #17
Source File: ReactivePersistenceProvider.java From hibernate-reactive with GNU Lesser General Public License v2.1 | 4 votes |
protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilder(PersistenceUnitInfo info, Map integration) { return getEntityManagerFactoryBuilder( new PersistenceUnitInfoDescriptor( info ), integration ); }
Example #18
Source File: HibernateJpaEntityManagerFactory.java From we-cmdb with Apache License 2.0 | 4 votes |
public EntityManagerFactory getEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = getPersistenceUnitInfo(getClass().getSimpleName()); Map<String, Object> configuration = new HashMap<>(); return new EntityManagerFactoryBuilderImpl(new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration, new CiClassLoaderService(classLoader)).build(); }
Example #19
Source File: JpaEntityManagerFactory.java From tutorials with MIT License | 4 votes |
protected EntityManagerFactory getEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = getPersistenceUnitInfo(getClass().getSimpleName()); Map<String, Object> configuration = new HashMap<>(); return new EntityManagerFactoryBuilderImpl(new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration) .build(); }
Example #20
Source File: JpaEntityManagerFactory.java From tutorials with MIT License | 4 votes |
protected EntityManagerFactory getEntityManagerFactory() { PersistenceUnitInfo persistenceUnitInfo = getPersistenceUnitInfo(getClass().getSimpleName()); Map<String, Object> configuration = new HashMap<>(); return new EntityManagerFactoryBuilderImpl(new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration) .build(); }