Package org.hibernate.boot.spi
Interface BootstrapContext
- All Known Implementing Classes:
BootstrapContextImpl
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 theArchiveDescriptorFactoryused for scanning.Access to collectedAttributeConverterdefinitions.Access to anyAuxiliaryDatabaseObjects explicitly registered with theMetadataBuilder.Access to all explicit cache region mappings.Access to class loading capabilities.Access to theClassLoaderService.Access to the sharedClassmateContextobject used throughout the bootstrap process.Access to theConfigurationService.TheBeanInstanceProducerto use when creating custom type references.TheSqmFunctionRegistrybelonging to thisBootstrapContext.Deprecated.In-flight form ofJpaComplianceAccess the temporaryClassLoaderpassed to us, as defined byPersistenceUnitInfo.getNewTempClassLoader(), if any.Access to theManagedBeanRegistry.Options specific to building the boot metamodelorg.hibernate.models.spi.ModelsContextAccess to thehibernate-modelsModelsContextAccess to the environment for scanning.Access to theScannerto 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.TheTypeConfigurationbelonging to thisBootstrapContext.booleanWhether the bootstrap was initiated from JPA bootstrapping.voidIndicates that bootstrap was initiated from JPA bootstrapping.voidregisterAdHocBasicType(BasicType<?> basicType) To support Envers.voidrelease()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()TheTypeConfigurationbelonging to thisBootstrapContext.- See Also:
-
getModelsContext
Access to thehibernate-modelsModelsContext -
getFunctionRegistry
SqmFunctionRegistry getFunctionRegistry()TheSqmFunctionRegistrybelonging to thisBootstrapContext.- See Also:
-
getCustomTypeProducer
BeanInstanceProducer getCustomTypeProducer()TheBeanInstanceProducerto use when creating custom type references.- Implementation Note:
- Usually a
TypeBeanInstanceProducer.
-
getMetadataBuildingOptions
MetadataBuildingOptions getMetadataBuildingOptions()Options specific to building the boot metamodel -
getClassLoaderService
ClassLoaderService getClassLoaderService()Access to theClassLoaderService. -
getManagedBeanRegistry
ManagedBeanRegistry getManagedBeanRegistry()Access to theManagedBeanRegistry. -
getConfigurationService
ConfigurationService getConfigurationService()Access to theConfigurationService. -
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,
falseis the assumed value. We only need to call this to mark ittrue.
-
getJpaTempClassLoader
ClassLoader getJpaTempClassLoader()Access the temporaryClassLoaderpassed to us, as defined byPersistenceUnitInfo.getNewTempClassLoader(), if any.- Returns:
- The temporary
ClassLoader
-
getClassLoaderAccess
ClassLoaderAccess getClassLoaderAccess()Access to class loading capabilities. -
getClassmateContext
Access to the sharedClassmateContextobject used throughout the bootstrap process. -
getArchiveDescriptorFactory
ArchiveDescriptorFactory getArchiveDescriptorFactory()Access to theArchiveDescriptorFactoryused 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 theScannerto be used for scanning.Can be:
- An instance of
Scanner, - a
Classreference to theScannerimplementor, or - a string naming the
Scannerimplementor.
- Returns:
- The scanner
- An instance of
-
getJandexView
Deprecated.Set via thehibernate-modelssettinghibernate.models.jandex.indexinsteadAccess to the Jandex index passed by call toMetadataBuilder.applyIndexView(Object), if any.- Returns:
- The Jandex index
-
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
SqmFunctionDescriptors registered viaMetadataBuilder
-
getAuxiliaryDatabaseObjectList
Collection<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectList()Access to anyAuxiliaryDatabaseObjects explicitly registered with theMetadataBuilder. This does not includeAuxiliaryDatabaseObjects defined in mappings.Should never return
null.- Returns:
- The
AuxiliaryDatabaseObjects registered viaMetadataBuilder
-
getAttributeConverters
Collection<ConverterDescriptor<?,?>> getAttributeConverters()Access to collectedAttributeConverterdefinitions.Should never return
null.- Returns:
- The
ConverterDescriptors 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.
-
hibernate-modelssettinghibernate.models.jandex.indexinstead