Package org.hibernate.jpa.boot.internal
Class EntityManagerFactoryBuilderImpl
- java.lang.Object
-
- org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl
-
- All Implemented Interfaces:
EntityManagerFactoryBuilder
public class EntityManagerFactoryBuilderImpl extends Object implements EntityManagerFactoryBuilder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EntityManagerFactoryBuilderImpl.MergedSettings
-
Field Summary
Fields Modifier and Type Field Description static String
INTEGRATOR_PROVIDER
Names aIntegratorProvider
static String
JANDEX_INDEX
Names a JandexIndex
instance to use.static String
METADATA_BUILDER_CONTRIBUTOR
Names aMetadataBuilderContributor
static String
STRATEGY_REGISTRATION_PROVIDERS
Names aStrategyRegistrationProviderList
static String
TYPE_CONTRIBUTORS
Names aTypeContributorList
-
Constructor Summary
Constructors Constructor Description EntityManagerFactoryBuilderImpl(PersistenceUnitDescriptor persistenceUnit, Map<String,Object> integrationSettings)
EntityManagerFactoryBuilderImpl(PersistenceUnitDescriptor persistenceUnit, Map<String,Object> integrationSettings, ClassLoader providedClassLoader)
EntityManagerFactoryBuilderImpl(PersistenceUnitDescriptor persistenceUnitDescriptor, Map<String,Object> integration, Consumer<EntityManagerFactoryBuilderImpl.MergedSettings> mergedSettingsBaseline)
For tests onlyEntityManagerFactoryBuilderImpl(PersistenceUnitDescriptor persistenceUnit, Map<String,Object> integrationSettings, ClassLoaderService providedClassLoaderService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityManagerFactory
build()
BuildEntityManagerFactory
instancevoid
cancel()
Cancel the building processing.void
generateSchema()
Perform an explicit schema generation (rather than an "auto" one) based on theMap<Object,Object>
getConfigurationValues()
protected EnhancementContext
getEnhancementContext(boolean dirtyTrackingEnabled, boolean lazyInitializationEnabled, boolean associationManagementEnabled)
Builds the context to be used in runtime bytecode enhancementManagedResources
getManagedResources()
MetadataImplementor
getMetadata()
Intended for internal testing only...protected StandardServiceRegistry
getStandardServiceRegistry()
Exposed to extensions: see Hibernate Reactiveprotected StandardServiceRegistryBuilder
getStandardServiceRegistryBuilder(BootstrapServiceRegistry bsr)
Extension point for subclasses.MetadataImplementor
metadata()
Used by extensions : Hibernate Reactiveprotected PersistenceException
persistenceException(String message, Exception cause)
protected void
populateSfBuilder(SessionFactoryBuilder sfBuilder, StandardServiceRegistry ssr)
EntityManagerFactoryBuilder
withDataSource(DataSource dataSource)
Allows passing in a DataSource (delayed from constructing the builder, AKA phase 2) to be used in building the EntityManagerFactoryEntityManagerFactoryBuilder
withValidatorFactory(Object validatorFactory)
Allows passing in a Java EE ValidatorFactory (delayed from constructing the builder, AKA phase 2) to be used in building the EntityManagerFactory
-
-
-
Field Detail
-
INTEGRATOR_PROVIDER
public static final String INTEGRATOR_PROVIDER
Names aIntegratorProvider
- See Also:
- Constant Field Values
-
STRATEGY_REGISTRATION_PROVIDERS
public static final String STRATEGY_REGISTRATION_PROVIDERS
Names aStrategyRegistrationProviderList
- See Also:
- Constant Field Values
-
TYPE_CONTRIBUTORS
public static final String TYPE_CONTRIBUTORS
Names aTypeContributorList
- See Also:
- Constant Field Values
-
METADATA_BUILDER_CONTRIBUTOR
public static final String METADATA_BUILDER_CONTRIBUTOR
Names aMetadataBuilderContributor
- See Also:
- Constant Field Values
-
JANDEX_INDEX
public static final String JANDEX_INDEX
Names a JandexIndex
instance to use.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EntityManagerFactoryBuilderImpl
public EntityManagerFactoryBuilderImpl(PersistenceUnitDescriptor persistenceUnit, Map<String,Object> integrationSettings)
-
EntityManagerFactoryBuilderImpl
public EntityManagerFactoryBuilderImpl(PersistenceUnitDescriptor persistenceUnit, Map<String,Object> integrationSettings, ClassLoader providedClassLoader)
-
EntityManagerFactoryBuilderImpl
public EntityManagerFactoryBuilderImpl(PersistenceUnitDescriptor persistenceUnit, Map<String,Object> integrationSettings, ClassLoaderService providedClassLoaderService)
-
EntityManagerFactoryBuilderImpl
@Internal public EntityManagerFactoryBuilderImpl(PersistenceUnitDescriptor persistenceUnitDescriptor, Map<String,Object> integration, Consumer<EntityManagerFactoryBuilderImpl.MergedSettings> mergedSettingsBaseline)
For tests only
-
-
Method Detail
-
getStandardServiceRegistryBuilder
protected StandardServiceRegistryBuilder getStandardServiceRegistryBuilder(BootstrapServiceRegistry bsr)
Extension point for subclasses. Used by Hibernate Reactive
-
getEnhancementContext
protected EnhancementContext getEnhancementContext(boolean dirtyTrackingEnabled, boolean lazyInitializationEnabled, boolean associationManagementEnabled)
Builds the context to be used in runtime bytecode enhancement- Parameters:
dirtyTrackingEnabled
- To enable dirty tracking featurelazyInitializationEnabled
- To enable lazy initialization featureassociationManagementEnabled
- To enable association management feature- Returns:
- An enhancement context for classes managed by this EM
-
getMetadata
public MetadataImplementor getMetadata()
Intended for internal testing only...
-
getManagedResources
public ManagedResources getManagedResources()
- Specified by:
getManagedResources
in interfaceEntityManagerFactoryBuilder
-
metadata
public MetadataImplementor metadata()
Used by extensions : Hibernate Reactive- Specified by:
metadata
in interfaceEntityManagerFactoryBuilder
-
withValidatorFactory
public EntityManagerFactoryBuilder withValidatorFactory(Object validatorFactory)
Description copied from interface:EntityManagerFactoryBuilder
Allows passing in a Java EE ValidatorFactory (delayed from constructing the builder, AKA phase 2) to be used in building the EntityManagerFactory- Specified by:
withValidatorFactory
in interfaceEntityManagerFactoryBuilder
- Parameters:
validatorFactory
- The ValidatorFactory- Returns:
this
, for method chaining
-
withDataSource
public EntityManagerFactoryBuilder withDataSource(DataSource dataSource)
Description copied from interface:EntityManagerFactoryBuilder
Allows passing in a DataSource (delayed from constructing the builder, AKA phase 2) to be used in building the EntityManagerFactory- Specified by:
withDataSource
in interfaceEntityManagerFactoryBuilder
- Parameters:
dataSource
- The DataSource to use- Returns:
this
, for method chaining
-
cancel
public void cancel()
Description copied from interface:EntityManagerFactoryBuilder
Cancel the building processing. This is used to signal the builder to release any resources in the case of something having gone wrong during the bootstrap process- Specified by:
cancel
in interfaceEntityManagerFactoryBuilder
-
generateSchema
public void generateSchema()
Description copied from interface:EntityManagerFactoryBuilder
Perform an explicit schema generation (rather than an "auto" one) based on the- Specified by:
generateSchema
in interfaceEntityManagerFactoryBuilder
-
build
public EntityManagerFactory build()
Description copied from interface:EntityManagerFactoryBuilder
BuildEntityManagerFactory
instance- Specified by:
build
in interfaceEntityManagerFactoryBuilder
- Returns:
- The built
EntityManagerFactory
-
populateSfBuilder
protected void populateSfBuilder(SessionFactoryBuilder sfBuilder, StandardServiceRegistry ssr)
-
persistenceException
protected PersistenceException persistenceException(String message, Exception cause)
-
getStandardServiceRegistry
protected StandardServiceRegistry getStandardServiceRegistry()
Exposed to extensions: see Hibernate Reactive
-
-