Top Description Methods
org.hibernate.boot.spi

public Interface BootstrapContext

Known Direct Implementers
org.hibernate.boot.internal.BootstrapContextImpl
Annotations
@Incubating
Imports
java.util.Collection, .Map, org.hibernate.Incubating, .Internal, org.hibernate.annotations.common.reflection.ReflectionManager, org.hibernate.boot.CacheRegionDefinition, .Metadata, org.hibernate.boot.archive.scan.spi.ScanEnvironment, .ScanOptions, org.hibernate.boot.archive.spi.ArchiveDescriptorFactory, org.hibernate.boot.internal.ClassmateContext, org.hibernate.boot.model.convert.spi.ConverterDescriptor, org.hibernate.boot.model.relational.AuxiliaryDatabaseObject, org.hibernate.boot.registry.StandardServiceRegistry, org.hibernate.id.factory.IdentifierGeneratorFactory, org.hibernate.jpa.spi.MutableJpaCompliance, org.hibernate.metamodel.spi.ManagedTypeRepresentationResolver, org.hibernate.query.sqm.function.SqmFunctionDescriptor, .SqmFunctionRegistry, org.hibernate.resource.beans.spi.BeanInstanceProducer, org.hibernate.type.BasicType, org.hibernate.type.spi.TypeConfiguration, org.jboss.jandex.IndexView

Defines a context for things available during the process of bootstrapping a org.hibernate.SessionFactory which are expected to be cleaned up after the SessionFactory is built.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public ArchiveDescriptorFactory
public Collection<ConverterDescriptor>

Returns:

The ConverterDescriptors registered via MetadataBuilder
getAttributeConverters
()

Access to collected jakarta.persistence.AttributeConverter definitions.

public Collection<AuxiliaryDatabaseObject>

Returns:

The AuxiliaryDatabaseObjects registered via MetadataBuilder
getAuxiliaryDatabaseObjectList
()

Access to any AuxiliaryDatabaseObjects explicitly registered with the org.hibernate.boot.MetadataBuilder.

public Collection<CacheRegionDefinition>

Returns:

Explicit cache region mappings
getCacheRegionDefinitions
()

Access to all explicit cache region mappings.

public ClassLoaderAccess
getClassLoaderAccess()

Access to class loading capabilities.

public ClassmateContext

Returns:

Access to the shared ClassmateContext delegates.
getClassmateContext
()

Access to the shared ClassmateContext object used throughout the bootstrap process.

public BeanInstanceProducer
getCustomTypeProducer()

The BeanInstanceProducer to use when creating custom type references.

public SqmFunctionRegistry
getFunctionRegistry()

The SqmFunctionRegistry belonging to this BootstrapContext.

public default IdentifierGeneratorFactory
public IndexView

Returns:

The Jandex index
getJandexView
()

Access to the Jandex index passed by call to org.hibernate.boot.MetadataBuilder#applyIndexView(IndexView), if any.

public MutableJpaCompliance
public ClassLoader

Returns:

The temporary ClassLoader
getJpaTempClassLoader
()

Access the temporary ClassLoader passed to us, as defined by jakarta.persistence.spi.PersistenceUnitInfo#getNewTempClassLoader(), if any.

public MetadataBuildingOptions
getMetadataBuildingOptions()

Options specific to building the boot metamodel

public ReflectionManager
getReflectionManager()

Retrieve the Hibernate Commons Annotations ReflectionManager.

public ManagedTypeRepresentationResolver
public ScanEnvironment

Returns:

The scan environment
getScanEnvironment
()

Access to the environment for scanning.

public Object

Returns:

The scanner
getScanner
()

Access to the org.hibernate.boot.archive.scan.spi.Scanner to be used for scanning.

public ScanOptions

Returns:

The scan options
getScanOptions
()

Access to the options to be used for scanning.

public StandardServiceRegistry
getServiceRegistry()

The service registry available to bootstrapping

public Map<String, SqmFunctionDescriptor>

Returns:

The SqmFunctionDescriptors registered via MetadataBuilder
getSqlFunctions
()

Access to any SQL functions explicitly registered with the org.hibernate.boot.MetadataBuilder.

public TypeConfiguration
getTypeConfiguration()

The TypeConfiguration belonging to this BootstrapContext.

public boolean
isJpaBootstrap()

Whether the bootstrap was initiated from JPA bootstrapping.

public void
markAsJpaBootstrap()

Indicates that bootstrap was initiated from JPA bootstrapping.

public void
registerAdHocBasicType(BasicType<?> basicType)

To support Envers.

public void
release()

Releases the "bootstrap only" resources held by this BootstrapContext.

public <T> BasicType<T>
resolveAdHocBasicType(String key)

To support Envers.

Method Detail

getArchiveDescriptorFactoryback to summary
public ArchiveDescriptorFactory getArchiveDescriptorFactory()

Access to the ArchiveDescriptorFactory used for scanning.

Returns:ArchiveDescriptorFactory

The ArchiveDescriptorFactory

getAttributeConvertersback to summary
public Collection<ConverterDescriptor> getAttributeConverters()

Access to collected jakarta.persistence.AttributeConverter definitions.

Should never return null.

Returns:Collection<ConverterDescriptor>

The ConverterDescriptors registered via MetadataBuilder

getAuxiliaryDatabaseObjectListback to summary
public Collection<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectList()

Access to any AuxiliaryDatabaseObjects explicitly registered with the org.hibernate.boot.MetadataBuilder. This does not include AuxiliaryDatabaseObjects defined in mappings.

Should never return null.

Returns:Collection<AuxiliaryDatabaseObject>

The AuxiliaryDatabaseObjects registered via MetadataBuilder

getCacheRegionDefinitionsback to summary
public Collection<CacheRegionDefinition> getCacheRegionDefinitions()

Access to all explicit cache region mappings.

Should never return null.

Returns:Collection<CacheRegionDefinition>

Explicit cache region mappings

getClassLoaderAccessback to summary
public ClassLoaderAccess getClassLoaderAccess()

Access to class loading capabilities.

getClassmateContextback to summary
public ClassmateContext getClassmateContext()

Access to the shared ClassmateContext object used throughout the bootstrap process.

Returns:ClassmateContext

Access to the shared ClassmateContext delegates.

getCustomTypeProducerback to summary
public BeanInstanceProducer getCustomTypeProducer()

The BeanInstanceProducer to use when creating custom type references.

getFunctionRegistryback to summary
public SqmFunctionRegistry getFunctionRegistry()

The SqmFunctionRegistry belonging to this BootstrapContext.

See Also
SqmFunctionRegistry
getIdentifierGeneratorFactoryback to summary
public default IdentifierGeneratorFactory getIdentifierGeneratorFactory()
getJandexViewback to summary
public IndexView getJandexView()

Access to the Jandex index passed by call to org.hibernate.boot.MetadataBuilder#applyIndexView(IndexView), if any.

API Note

Jandex is currently not used, see the roadmap

Returns:IndexView

The Jandex index

getJpaComplianceback to summary
public MutableJpaCompliance getJpaCompliance()

In-flight form of org.hibernate.jpa.spi.JpaCompliance

getJpaTempClassLoaderback to summary
public ClassLoader getJpaTempClassLoader()

Access the temporary ClassLoader passed to us, as defined by jakarta.persistence.spi.PersistenceUnitInfo#getNewTempClassLoader(), if any.

Returns:ClassLoader

The temporary ClassLoader

getMetadataBuildingOptionsback to summary
public MetadataBuildingOptions getMetadataBuildingOptions()

Options specific to building the boot metamodel

getReflectionManagerback to summary
public ReflectionManager getReflectionManager()

Retrieve the Hibernate Commons Annotations ReflectionManager.

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.

Annotations
@Internal
getRepresentationStrategySelectorback to summary
public ManagedTypeRepresentationResolver getRepresentationStrategySelector()
See Also
ManagedTypeRepresentationResolver
getScanEnvironmentback to summary
public ScanEnvironment getScanEnvironment()

Access to the environment for scanning.

API Note

Consider this temporary; see discussion on ScanEnvironment.

Returns:ScanEnvironment

The scan environment

getScannerback to summary
public Object getScanner()

Access to the org.hibernate.boot.archive.scan.spi.Scanner to be used for scanning.

Can be:

Returns:Object

The scanner

getScanOptionsback to summary
public ScanOptions getScanOptions()

Access to the options to be used for scanning.

Returns:ScanOptions

The scan options

getServiceRegistryback to summary
public StandardServiceRegistry getServiceRegistry()

The service registry available to bootstrapping

getSqlFunctionsback to summary
public Map<String, SqmFunctionDescriptor> getSqlFunctions()

Access to any SQL functions explicitly registered with the org.hibernate.boot.MetadataBuilder. This does not include Dialect-registered functions.

Should never return null.

Returns:Map<String, SqmFunctionDescriptor>

The SqmFunctionDescriptors registered via MetadataBuilder

getTypeConfigurationback to summary
public TypeConfiguration getTypeConfiguration()

The TypeConfiguration belonging to this BootstrapContext.

See Also
TypeConfiguration
isJpaBootstrapback to summary
public boolean isJpaBootstrap()

Whether the bootstrap was initiated from JPA bootstrapping.

Implementation Specification

This is used

See Also
markAsJpaBootstrap()
markAsJpaBootstrapback to summary
public 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 it true.

registerAdHocBasicTypeback to summary
public void registerAdHocBasicType(BasicType<?> basicType)

To support Envers.

releaseback to summary
public void release()

Releases the "bootstrap only" resources held by this BootstrapContext.

resolveAdHocBasicTypeback to summary
public <T> BasicType<T> resolveAdHocBasicType(String key)

To support Envers.