Top Fields Constructors Methods
org.hibernate.boot.internal

public Class SessionFactoryBuilderImpl

extends Object
implements SessionFactoryBuilderImplementor
Class Inheritance
All Implemented Interfaces
org.hibernate.boot.spi.SessionFactoryBuilderImplementor, org.hibernate.boot.SessionFactoryBuilder
Imports
java.util.Map, java.util.function.Supplier, org.hibernate.CustomEntityDirtinessStrategy, .EntityNameResolver, .Interceptor, .SessionFactory, .SessionFactoryObserver, org.hibernate.boot.SessionFactoryBuilder, .TempTableDdlTransactionHandling, org.hibernate.boot.spi.BootstrapContext, .MetadataImplementor, .SessionFactoryBuilderImplementor, .SessionFactoryOptions, org.hibernate.bytecode.internal.SessionFactoryObserverForBytecodeEnhancer, org.hibernate.bytecode.spi.BytecodeProvider, org.hibernate.cache.spi.TimestampsCacheFactory, org.hibernate.context.spi.CurrentTenantIdentifierResolver, org.hibernate.internal.SessionFactoryImpl, org.hibernate.loader.BatchFetchStyle, org.hibernate.proxy.EntityNotFoundDelegate, org.hibernate.query.NullPrecedence, org.hibernate.query.sqm.function.SqmFunctionDescriptor, org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode, .StatementInspector, org.hibernate.type.format.FormatMapper

Authors
Gail Badner, Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final BootstrapContext
private final MetadataImplementor
metadata

Deprecated as a consequence of MetadataImplementor being deprecated.
private final SessionFactoryOptionsBuilder

Constructor Summary

AccessConstructor and Description
public
SessionFactoryBuilderImpl(MetadataImplementor metadata, BootstrapContext bootstrapContext)

Deprecated as a consequence of MetadataImplementor being deprecated.
public
SessionFactoryBuilderImpl(MetadataImplementor metadata, SessionFactoryOptionsBuilder optionsBuilder, BootstrapContext context)

Deprecated as a consequence of MetadataImplementor being deprecated.
public
SessionFactoryBuilderImpl(MetadataImplementor metadata, SessionFactoryOptionsBuilder optionsBuilder)

Deprecated for removal since 6.2. This constructor will be removed

Method Summary

Modifier and TypeMethod and Description
public SessionFactoryBuilder
addEntityNameResolver(EntityNameResolver...
The entityNameResolvers to add
entityNameResolvers
)

Implements org.hibernate.boot.SessionFactoryBuilder.addEntityNameResolver.

Specifies one or more entity name resolvers.
public SessionFactoryBuilder
public SessionFactoryBuilder
public SessionFactoryBuilder
applyAutoClosing(boolean
true indicates they should be auto-closed; false indicates not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyAutoClosing.

Specifies whether org.hibernate.Sessions should be automatically closed at the end of the transaction.
public SessionFactoryBuilder
applyAutoFlushing(boolean
true indicates they should be auto-flushed; false indicates not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyAutoFlushing.

Applies whether org.hibernate.Sessions should be automatically flushed at the end of the transaction.
public SessionFactoryBuilder
applyAutomaticEvictionOfCollectionCaches(boolean
true indicates that these collection caches should be evicted automatically.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyAutomaticEvictionOfCollectionCaches.

When using bidirectional many-to-one associations and caching the one-to-many side it is expected that both sides of the association are managed (actually that is true of all bidirectional associations).
public SessionFactoryBuilder
applyBatchFetchStyle(BatchFetchStyle
The style to use
style
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyBatchFetchStyle.

Deprecated as a consequence of BatchFetchStyle being deprecated.
What style of batching should be used?
public SessionFactoryBuilder
public SessionFactoryBuilder
applyCacheRegionPrefix(String
The prefix.
prefix
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyCacheRegionPrefix.

Specify a prefix to prepended to all cache region names.
public SessionFactoryBuilder
applyCollectionsInDefaultFetchGroup(boolean
true collections should be included, false they should not. Default is true.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyCollectionsInDefaultFetchGroup.

Should collections be included in the default fetch group when bytecode enhancement is used?
public SessionFactoryBuilder
applyConnectionHandlingMode(PhysicalConnectionHandlingMode
The handling mode to apply
connectionHandlingMode
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyConnectionHandlingMode.

Specifies the connection handling mode for JDBC connections.
public SessionFactoryBuilder
public SessionFactoryBuilder
applyCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver<?>
The resolution strategy to use.
resolver
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyCurrentTenantIdentifierResolver.

Specifies a CurrentTenantIdentifierResolver that is responsible for resolving the current tenant identifier.
public SessionFactoryBuilder
public SessionFactoryBuilder
applyDefaultBatchFetchSize(int
The size to use for batch fetching for entities/collections which do not specify an explicit batch fetch size.
size
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyDefaultBatchFetchSize.

Specifies a default batch fetch size for all entities and collections which do not otherwise specify a batch fetch size.
public SessionFactoryBuilder
applyDefaultNullPrecedence(NullPrecedence
The default null precedence to use.
nullPrecedence
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyDefaultNullPrecedence.

Apply a null precedence, NULLS FIRST or NULLS LAST, to order by clauses rendered in SQL queries.
public SessionFactoryBuilder
public SessionFactoryBuilder
applyDirectReferenceCaching(boolean
true indicates that applicable entities will be stored into the second-level cache directly by reference; false indicates that all entities will be stored via the extraction approach.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyDirectReferenceCaching.

Generally, Hibernate will extract the information from an entity and put that extracted information into the second-level cache.
public SessionFactoryBuilder
public SessionFactoryBuilder
applyGetGeneratedKeysSupport(boolean
true indicates we should use JDBC getGeneratedKeys support; false indicates we should not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyGetGeneratedKeysSupport.

Should JDBC java.sql.PreparedStatement#getGeneratedKeys() feature be used for retrieval of *insert-generated* ids?
public SessionFactoryBuilder
applyIdentifierRollbackSupport(boolean
true indicates identifiers should be unset; false indicates not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyIdentifierRollbackSupport.

Should the generated identifier be "unset" when an entity is deleted?
public SessionFactoryBuilder
applyInterceptor(Interceptor
The interceptor
interceptor
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyInterceptor.

Specifies an Interceptor associated with the SessionFactory, which will be used by all sessions unless an interceptor is explicitly specified using org.hibernate.SessionBuilder#interceptor.
public SessionFactoryBuilder
applyJdbcBatchingForVersionedEntities(boolean
The batch size to use.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyJdbcBatchingForVersionedEntities.

This setting controls whether versioned entities will be included in JDBC batching.
public SessionFactoryBuilder
applyJdbcBatchSize(int
The batch size to use.
size
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyJdbcBatchSize.

Specifies the maximum number of statements to batch together in a JDBC batch for insert, update and delete operations.
public SessionFactoryBuilder
applyJdbcFetchSize(int
The fetch size to be passed to the driver.
size
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyJdbcFetchSize.

Apply a fetch size to the JDBC driver for fetching results.
public SessionFactoryBuilder
applyJsonFormatMapper(FormatMapper
The FormatMapper to use.
jsonFormatMapper
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyJsonFormatMapper.

Specifies a format mapper to use for serialization/deserialization of JSON properties.
public SessionFactoryBuilder
applyJtaTrackingByThread(boolean
true indicates we should track by thread; false indicates not
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyJtaTrackingByThread.

If using the built-in JTA-based org.hibernate.resource.transaction.spi.TransactionCoordinator or org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder, should it track JTA transactions by thread in an attempt to detect timeouts?
public SessionFactoryBuilder
applyLazyInitializationOutsideTransaction(boolean
true indicates initialization outside the transaction should be allowed; false indicates it should not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyLazyInitializationOutsideTransaction.

Should the application be allowed to initialize uninitialized lazy state outside the bounds of a transaction?
public SessionFactoryBuilder
applyMaximumFetchDepth(int
The depth for limiting joins.
depth
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyMaximumFetchDepth.

Apply a limit to the depth Hibernate will use for outer joins.
public SessionFactoryBuilder
applyMinimalPutsForCaching(boolean
true indicates Hibernate should first check whether data exists and only push to the cache if it does not already exist. false indicates to perform the default behavior.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyMinimalPutsForCaching.

By default, Hibernate will always just push data into the cache without first checking if that data already exists.
public SessionFactoryBuilder
applyMultiTenancy(boolean
True if multi-tenancy in use.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyMultiTenancy.

Specifies whether multi-tenancy is enabled
public SessionFactoryBuilder
applyName(String
The name to use
sessionFactoryName
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyName.

Specifies a name for the SessionFactory.
public SessionFactoryBuilder
applyNameAsJndiName(boolean
true indicates that the name specified in applyName will be used for binding the SessionFactory into JNDI.
isJndiName
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyNameAsJndiName.

Specifies that the SessionFactory should be registered in JNDI, under the name specified using applyName(String).
public SessionFactoryBuilder
applyNamedQueryCheckingOnStartup(boolean
true indicates that they should; false indicates they should not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyNamedQueryCheckingOnStartup.

Should named queries be checked on startup?
public SessionFactoryBuilder
applyNullabilityChecking(boolean
true indicates that Hibernate should perform nullness checking; false indicates it should not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyNullabilityChecking.

Should attributes using columns marked as not-null be checked (by Hibernate) for nullness, or should this be left as a job for the database?
public SessionFactoryBuilder
applyOrderingOfInserts(boolean
true indicates that ordering should be enabled; false indicates not
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyOrderingOfInserts.

Specify whether ordering of inserts should be enabled.
public SessionFactoryBuilder
applyOrderingOfUpdates(boolean
true indicates that ordering should be enabled; false indicates not
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyOrderingOfUpdates.

Specify whether ordering of updates should be enabled.
public SessionFactoryBuilder
public SessionFactoryBuilder
applyQueryCacheSupport(boolean
true indicates we should enable the use of second level query caching; false indicates we should disable the use of second level query caching.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyQueryCacheSupport.

Should second level query caching support be enabled?
public SessionFactoryBuilder
applyScrollableResultsSupport(boolean
true to enable this support, false to disable it
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyScrollableResultsSupport.

Should scrollable results be supported in queries?
public SessionFactoryBuilder
applySecondLevelCacheSupport(boolean
true indicates we should enable the use of second level caching; false indicates we should disable the use of second level caching.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applySecondLevelCacheSupport.

Should second level caching support be enabled?
public SessionFactoryBuilder
applySqlComments(boolean
true indicates comments should be applied; false indicates not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applySqlComments.

Should Hibernate apply comments to SQL it generates?
public SessionFactoryBuilder
applySqlFunction(String
The function name to register it under
registrationName
,
SqmFunctionDescriptor functionDescriptor)

Implements org.hibernate.boot.SessionFactoryBuilder.applySqlFunction.

Register a SQL function with the underlying org.hibernate.query.sqm.function.SqmFunctionRegistry.
public SessionFactoryBuilder
applyStatelessInterceptor(Class<? extends Interceptor>
The interceptor class
statelessInterceptorClass
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyStatelessInterceptor.

Specifies an interceptor Class associated with the SessionFactory, which is used to instantiate a new interceptor for each session, unless an interceptor is explicitly specified using org.hibernate.SessionBuilder#interceptor.
public SessionFactoryBuilder
applyStatelessInterceptor(Supplier<? extends Interceptor>
Supplier instance which is used to retrieve the interceptor
statelessInterceptorSupplier
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyStatelessInterceptor.

Specifies an interceptor Supplier associated with the SessionFactory, which is used to obtain an interceptor for each session, unless an interceptor is explicitly specified using org.hibernate.SessionBuilder#interceptor.
public SessionFactoryBuilder
applyStatementInspector(StatementInspector
The StatementInspector
statementInspector
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyStatementInspector.

Specifies a StatementInspector associated with the SessionFactory, which will be used by all sessions unless a statement inspector is explicitly specified using org.hibernate.SessionBuilder#statementInspector
public SessionFactoryBuilder
applyStatisticsSupport(boolean
true indicates that statistics gathering should be enabled; false indicates not.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyStatisticsSupport.

Specifies whether statistics gathering is enabled.
public SessionFactoryBuilder
applyStructuredCacheEntries(boolean
true indicates that structured (human-readable) cache entries should be used; false indicates that the native entry structure should be used.
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyStructuredCacheEntries.

By default, Hibernate stores data in the cache in its own optimized format.
public SessionFactoryBuilder
applySubselectFetchEnabled(boolean
true indicates that subselect fetching is enabled
enabled
)

Implements org.hibernate.boot.SessionFactoryBuilder.applySubselectFetchEnabled.

Enable the use of subselect fetching.
public SessionFactoryBuilder
public SessionFactoryBuilder
public SessionFactoryBuilder
applyValidatorFactory(Object
The Bean Validation ValidatorFactory to use
validatorFactory
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyValidatorFactory.

Specifies a Bean Validation jakarta.validation.ValidatorFactory.
public SessionFactoryBuilder
applyXmlFormatMapper(FormatMapper
The FormatMapper to use.
xmlFormatMapper
)

Implements org.hibernate.boot.SessionFactoryBuilder.applyXmlFormatMapper.

Specifies a format mapper to use for serialization/deserialization of XML properties.
public SessionFactory
build()

Implements org.hibernate.boot.SessionFactoryBuilder.build.

After all options have been set, build the SessionFactory.
public SessionFactoryOptions
public void
public void
public SessionFactoryBuilder
public SessionFactoryBuilder
public SessionFactoryBuilder
public SessionFactoryBuilder
public SessionFactoryBuilder
public SessionFactoryBuilder
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait