Package org.hibernate.boot.spi
Interface BootstrapContext
-
- All Known Implementing Classes:
BootstrapContextImpl
,BootstrapContextImpl
@Incubating public interface BootstrapContext
Defines a context for things available during the process of bootstrapping aSessionFactory
which are expected to be cleaned up after theSessionFactory
is built.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ArchiveDescriptorFactory
getArchiveDescriptorFactory()
Access to theArchiveDescriptorFactory
used for scanning.Collection<ConverterDescriptor>
getAttributeConverters()
Access to collectedAttributeConverter
definitions.Collection<AuxiliaryDatabaseObject>
getAuxiliaryDatabaseObjectList()
Access to anyAuxiliaryDatabaseObject
s explicitly registered with theMetadataBuilder
.Collection<CacheRegionDefinition>
getCacheRegionDefinitions()
Access to all explicit cache region mappings.ClassLoaderAccess
getClassLoaderAccess()
Access to class loading capabilities.ClassmateContext
getClassmateContext()
Access to the sharedClassmateContext
object used throughout the bootstrap process.BeanInstanceProducer
getCustomTypeProducer()
TheBeanInstanceProducer
to use when creating custom type references.SqmFunctionRegistry
getFunctionRegistry()
TheSqmFunctionRegistry
belonging to thisBootstrapContext
.default IdentifierGeneratorFactory
getIdentifierGeneratorFactory()
org.jboss.jandex.IndexView
getJandexView()
Access to the Jandex index passed by call toMetadataBuilder.applyIndexView(IndexView)
, if any.MutableJpaCompliance
getJpaCompliance()
In-flight form ofJpaCompliance
ClassLoader
getJpaTempClassLoader()
Access the temporaryClassLoader
passed to us, as defined byPersistenceUnitInfo.getNewTempClassLoader()
, if any.MetadataBuildingOptions
getMetadataBuildingOptions()
Options specific to building the boot metamodelorg.hibernate.annotations.common.reflection.ReflectionManager
getReflectionManager()
Retrieve the Hibernate Commons AnnotationsReflectionManager
.ManagedTypeRepresentationResolver
getRepresentationStrategySelector()
ScanEnvironment
getScanEnvironment()
Access to the environment for scanning.Object
getScanner()
Access to theScanner
to be used for scanning.ScanOptions
getScanOptions()
Access to the options to be used for scanning.StandardServiceRegistry
getServiceRegistry()
The service registry available to bootstrappingMap<String,SqmFunctionDescriptor>
getSqlFunctions()
Access to any SQL functions explicitly registered with theMetadataBuilder
.TypeConfiguration
getTypeConfiguration()
TheTypeConfiguration
belonging to thisBootstrapContext
.boolean
isJpaBootstrap()
Whether the bootstrap was initiated from JPA bootstrapping.void
markAsJpaBootstrap()
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>
resolveAdHocBasicType(String key)
To support Envers.
-
-
-
Method Detail
-
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:
TypeConfiguration
-
getFunctionRegistry
SqmFunctionRegistry getFunctionRegistry()
TheSqmFunctionRegistry
belonging to thisBootstrapContext
.- See Also:
SqmFunctionRegistry
-
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
default IdentifierGeneratorFactory getIdentifierGeneratorFactory()
-
isJpaBootstrap
boolean isJpaBootstrap()
Whether the bootstrap was initiated from JPA bootstrapping.- See Also:
markAsJpaBootstrap()
- 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
@Internal org.hibernate.annotations.common.reflection.ReflectionManager 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:
ManagedTypeRepresentationResolver
-
release
void release()
Releases the "bootstrap only" resources held by thisBootstrapContext
.
-
registerAdHocBasicType
void registerAdHocBasicType(BasicType<?> basicType)
To support Envers.
-
-