Package org.hibernate.boot.spi
Interface BootstrapContext
- All Known Implementing Classes:
BootstrapContextImpl
,BootstrapContextImpl
,MockSessionFactory
,ProcessorSessionFactory
Defines a context for things available during the process of bootstrapping
a
SessionFactory
which are expected to be cleaned up
after the SessionFactory
is built.-
Method Summary
Modifier and TypeMethodDescriptionAccess to theArchiveDescriptorFactory
used for scanning.Access to collectedAttributeConverter
definitions.Access to anyAuxiliaryDatabaseObject
s explicitly registered with theMetadataBuilder
.Access to all explicit cache region mappings.Access to class loading capabilities.Access to the sharedClassmateContext
object used throughout the bootstrap process.TheBeanInstanceProducer
to use when creating custom type references.TheSqmFunctionRegistry
belonging to thisBootstrapContext
.default IdentifierGeneratorFactory
org.jboss.jandex.IndexView
Access to the Jandex index passed by call toMetadataBuilder.applyIndexView(IndexView)
, if any.In-flight form ofJpaCompliance
Access the temporaryClassLoader
passed to us, as defined byPersistenceUnitInfo.getNewTempClassLoader()
, if any.Options specific to building the boot metamodelorg.hibernate.annotations.common.reflection.ReflectionManager
Retrieve the Hibernate Commons AnnotationsReflectionManager
.Access to the environment for scanning.Access to theScanner
to be used for scanning.Access to the options to be used for scanning.The service registry available to bootstrappingAccess to any SQL functions explicitly registered with theMetadataBuilder
.TheTypeConfiguration
belonging to thisBootstrapContext
.boolean
Whether the bootstrap was initiated from JPA bootstrapping.void
Indicates that bootstrap was initiated from JPA bootstrapping.void
registerAdHocBasicType
(BasicType<?> basicType) To support Envers.void
release()
Releases the "bootstrap only" resources held by thisBootstrapContext
.<T> BasicType<T>
To support Envers.
-
Method Details
-
getServiceRegistry
StandardServiceRegistry getServiceRegistry()The service registry available to bootstrapping -
getJpaCompliance
MutableJpaCompliance getJpaCompliance()In-flight form ofJpaCompliance
-
getTypeConfiguration
TypeConfiguration getTypeConfiguration()TheTypeConfiguration
belonging to thisBootstrapContext
.- See Also:
-
getFunctionRegistry
SqmFunctionRegistry getFunctionRegistry()TheSqmFunctionRegistry
belonging to thisBootstrapContext
.- See Also:
-
getCustomTypeProducer
BeanInstanceProducer getCustomTypeProducer()TheBeanInstanceProducer
to use when creating custom type references.- Implementation Note:
- Usually a
TypeBeanInstanceProducer
.
-
getMetadataBuildingOptions
MetadataBuildingOptions getMetadataBuildingOptions()Options specific to building the boot metamodel -
getIdentifierGeneratorFactory
-
isJpaBootstrap
boolean isJpaBootstrap()Whether the bootstrap was initiated from JPA bootstrapping.- See Also:
- Implementation Specification:
- This is used
-
markAsJpaBootstrap
void markAsJpaBootstrap()Indicates that bootstrap was initiated from JPA bootstrapping.- Implementation Specification:
- Internally,
false
is the assumed value. We only need to call this to mark ittrue
.
-
getJpaTempClassLoader
ClassLoader getJpaTempClassLoader()Access the temporaryClassLoader
passed to us, as defined byPersistenceUnitInfo.getNewTempClassLoader()
, if any.- Returns:
- The temporary
ClassLoader
-
getClassLoaderAccess
ClassLoaderAccess getClassLoaderAccess()Access to class loading capabilities. -
getClassmateContext
ClassmateContext getClassmateContext()Access to the sharedClassmateContext
object used throughout the bootstrap process.- Returns:
- Access to the shared
ClassmateContext
delegates.
-
getArchiveDescriptorFactory
ArchiveDescriptorFactory getArchiveDescriptorFactory()Access to theArchiveDescriptorFactory
used for scanning.- Returns:
- The
ArchiveDescriptorFactory
-
getScanOptions
ScanOptions getScanOptions()Access to the options to be used for scanning.- Returns:
- The scan options
-
getScanEnvironment
ScanEnvironment getScanEnvironment()Access to the environment for scanning.- Returns:
- The scan environment
- API Note:
- Consider this temporary; see discussion on
ScanEnvironment
.
-
getScanner
Object getScanner()Access to theScanner
to be used for scanning.Can be:
- An instance of
Scanner
, - a
Class
reference to theScanner
implementor, or - a string naming the
Scanner
implementor.
- Returns:
- The scanner
- An instance of
-
getReflectionManager
Retrieve the Hibernate Commons AnnotationsReflectionManager
.- API Note:
- Supported for internal use only. This method will go away as we migrate away from Hibernate Commons Annotations to Jandex for annotation handling and XMl to annotation merging.
-
getJandexView
org.jboss.jandex.IndexView getJandexView()Access to the Jandex index passed by call toMetadataBuilder.applyIndexView(IndexView)
, if any.- Returns:
- The Jandex index
- API Note:
- Jandex is currently not used, see the roadmap
-
getSqlFunctions
Map<String,SqmFunctionDescriptor> getSqlFunctions()Access to any SQL functions explicitly registered with theMetadataBuilder
. This does not includeDialect
-registered functions.Should never return
null
.- Returns:
- The
SqmFunctionDescriptor
s registered viaMetadataBuilder
-
getAuxiliaryDatabaseObjectList
Collection<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectList()Access to anyAuxiliaryDatabaseObject
s explicitly registered with theMetadataBuilder
. This does not includeAuxiliaryDatabaseObject
s defined in mappings.Should never return
null
.- Returns:
- The
AuxiliaryDatabaseObject
s registered viaMetadataBuilder
-
getAttributeConverters
Collection<ConverterDescriptor> getAttributeConverters()Access to collectedAttributeConverter
definitions.Should never return
null
.- Returns:
- The
ConverterDescriptor
s registered viaMetadataBuilder
-
getCacheRegionDefinitions
Collection<CacheRegionDefinition> getCacheRegionDefinitions()Access to all explicit cache region mappings.Should never return
null
.- Returns:
- Explicit cache region mappings
-
getRepresentationStrategySelector
ManagedTypeRepresentationResolver getRepresentationStrategySelector()- See Also:
-
release
void release()Releases the "bootstrap only" resources held by thisBootstrapContext
. -
registerAdHocBasicType
To support Envers. -
resolveAdHocBasicType
To support Envers.
-