Class SessionFactoryBuilderImpl
- All Implemented Interfaces:
SessionFactoryBuilder
,SessionFactoryBuilderImplementor
-
Constructor Summary
ConstructorsConstructorDescriptionSessionFactoryBuilderImpl
(MetadataImplementor metadata, SessionFactoryOptionsBuilder optionsBuilder, BootstrapContext context) SessionFactoryBuilderImpl
(MetadataImplementor metadata, BootstrapContext bootstrapContext) -
Method Summary
Modifier and TypeMethodDescriptionaddEntityNameResolver
(EntityNameResolver... entityNameResolvers) Specifies one or more entity name resolvers.addSessionFactoryObservers
(SessionFactoryObserver... observers) Specifies one or more observers.allowOutOfTransactionUpdateOperations
(boolean allow) applyAutoClosing
(boolean enabled) Specifies whetherSession
s should be automatically closed at the end of the transaction.applyAutoFlushing
(boolean enabled) Applies whetherSession
s should be automatically flushed at the end of the transaction.applyAutomaticEvictionOfCollectionCaches
(boolean enabled) 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).applyBeanManager
(Object beanManager) Specifies a CDIBeanManager
.applyCacheRegionPrefix
(String prefix) Specify a prefix to prepended to all cache region names.applyCollectionsInDefaultFetchGroup
(boolean enabled) Should collections be included in the default fetch group when bytecode enhancement is used?applyConnectionHandlingMode
(PhysicalConnectionHandlingMode connectionHandlingMode) Specifies the connection handling mode for JDBC connections.applyConnectionProviderDisablesAutoCommit
(boolean providerDisablesAutoCommit) Specifies aCurrentTenantIdentifierResolver
that is responsible for resolving the current tenant identifier.Specifies aCustomEntityDirtinessStrategy
.applyDefaultBatchFetchSize
(int size) Specifies a default batch fetch size for all entities and collections which do not otherwise specify a batch fetch size.applyDefaultNullPrecedence
(Nulls nullPrecedence) Apply a null precedence,NULLS FIRST
orNULLS LAST
, toorder by
clauses rendered in SQL queries.applyDelayedEntityLoaderCreations
(boolean delay) Should entity loaders be generated immediately? Or should the creation be delayed until first need?applyDirectReferenceCaching
(boolean enabled) Generally, Hibernate will extract the information from an entity and put that extracted information into the second-level cache.applyEntityNotFoundDelegate
(EntityNotFoundDelegate entityNotFoundDelegate) Specifies anEntityNotFoundDelegate
.applyGetGeneratedKeysSupport
(boolean enabled) Should JDBCStatement.getGeneratedKeys()
feature be used for retrieval of *insert-generated* ids?applyIdentifierRollbackSupport
(boolean enabled) Should the generated identifier be "unset" when an entity is deleted?applyInterceptor
(Interceptor interceptor) Specifies anInterceptor
associated with theSessionFactory
, which will be used by all sessions unless an interceptor is explicitly specified usingSessionBuilder.interceptor(org.hibernate.Interceptor)
.applyJdbcBatchingForVersionedEntities
(boolean enabled) This setting controls whether versioned entities will be included in JDBC batching.applyJdbcBatchSize
(int size) Specifies the maximum number of statements to batch together in a JDBC batch for insert, update and delete operations.applyJdbcFetchSize
(int size) Apply a fetch size to the JDBC driver for fetching results.applyJsonFormatMapper
(FormatMapper jsonFormatMapper) Specifies aformat mapper
to use for serialization/deserialization of JSON properties.applyJtaTrackingByThread
(boolean enabled) If using the built-in JTA-basedTransactionCoordinator
orTransactionCoordinatorBuilder
, should it track JTA transactions by thread in an attempt to detect timeouts?applyLazyInitializationOutsideTransaction
(boolean enabled) Should the application be allowed to initialize uninitialized lazy state outside the bounds of a transaction?applyMaximumFetchDepth
(int depth) Apply a limit to the depth Hibernate will use for outer joins.applyMinimalPutsForCaching
(boolean enabled) By default, Hibernate will always just push data into the cache without first checking if that data already exists.applyMultiTenancy
(boolean enabled) Specifies whether multitenancy is enabled via use of aMultiTenantConnectionProvider
.Specifies a name for theSessionFactory
.applyNameAsJndiName
(boolean isJndiName) Specifies that theSessionFactory
should be registered in JNDI, under the name specified usingSessionFactoryBuilder.applyName(String)
.applyNamedQueryCheckingOnStartup
(boolean enabled) Should named queries be checked on startup?applyNullabilityChecking
(boolean enabled) 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?applyOrderingOfInserts
(boolean enabled) Specify whether ordering of inserts should be enabled.applyOrderingOfUpdates
(boolean enabled) Specify whether ordering of updates should be enabled.applyPreferUserTransactions
(boolean preferUserTransactions) If using the built-in JTA-basedTransactionCoordinator
orTransactionCoordinatorBuilder
, should it prefer to useUserTransaction
in preference toTransaction
?applyQueryCacheLayout
(CacheLayout cacheLayout) Specifies the defaultCacheLayout
to use for query cache entries.applyQueryCacheSupport
(boolean enabled) Should second level query caching support be enabled?applyScrollableResultsSupport
(boolean enabled) Should scrollable results be supported in queries? We ask the JDBC driver whether it supports scrollable result sets as the default for this setting, but some drivers do not accurately report this via DatabaseMetaData.applySecondLevelCacheSupport
(boolean enabled) Should second level caching support be enabled?applySqlComments
(boolean enabled) Should Hibernate apply comments to SQL it generates?applySqlFunction
(String registrationName, SqmFunctionDescriptor functionDescriptor) Register aSQL function
with the underlyingSqmFunctionRegistry
.applyStatelessInterceptor
(Class<? extends Interceptor> statelessInterceptorClass) Specifies an interceptorClass
associated with theSessionFactory
, which is used to instantiate a new interceptor for each session, unless an interceptor is explicitly specified usingSessionBuilder.interceptor(org.hibernate.Interceptor)
.applyStatelessInterceptor
(Supplier<? extends Interceptor> statelessInterceptorSupplier) Specifies an interceptorSupplier
associated with theSessionFactory
, which is used to obtain an interceptor for each session, unless an interceptor is explicitly specified usingSessionBuilder.interceptor(org.hibernate.Interceptor)
.applyStatementInspector
(StatementInspector statementInspector) Specifies aStatementInspector
associated with theSessionFactory
, which will be used by all sessions unless a statement inspector is explicitly specified usingSessionBuilder.statementInspector(org.hibernate.resource.jdbc.spi.StatementInspector)
applyStatisticsSupport
(boolean enabled) Specifies whether statistics gathering is enabled.applyStructuredCacheEntries
(boolean enabled) By default, Hibernate stores data in the cache in its own optimized format.applySubselectFetchEnabled
(boolean enabled) Enable the use of subselect fetching.Specifies how temporary tables should be created or dropped with respect to transaction handling.Specifies aTimestampsCacheFactory
.applyValidatorFactory
(Object validatorFactory) Specifies a Bean ValidationValidatorFactory
.applyXmlFormatMapper
(FormatMapper xmlFormatMapper) Specifies aformat mapper
to use for serialization/deserialization of XML properties.build()
After all options have been set, build the SessionFactory.Build theSessionFactoryOptions
that will ultimately be passed to the constructor ofSessionFactoryImpl
.void
Called ifTransactionSettings.ALLOW_JTA_TRANSACTION_ACCESS
is not enabled.enableJpaCascadeCompliance
(boolean enabled) Deprecated.enableJpaClosedCompliance
(boolean enabled) enableJpaOrderByMappingCompliance
(boolean enabled) enableJpaQueryCompliance
(boolean enabled) enableJpaTransactionCompliance
(boolean enabled) enableReleaseResourcesOnCloseEnabled
(boolean enable) Should resources held by anEntityManager
be released immediately on close?Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.boot.spi.SessionFactoryBuilderImplementor
disableRefreshDetachedEntity
-
Constructor Details
-
SessionFactoryBuilderImpl
-
SessionFactoryBuilderImpl
public SessionFactoryBuilderImpl(MetadataImplementor metadata, SessionFactoryOptionsBuilder optionsBuilder, BootstrapContext context)
-
-
Method Details
-
applyBeanManager
Description copied from interface:SessionFactoryBuilder
Specifies a CDIBeanManager
.- Specified by:
applyBeanManager
in interfaceSessionFactoryBuilder
- Parameters:
beanManager
- The CDIBeanManager
to use- Returns:
this
, for method chaining- See Also:
-
applyValidatorFactory
Description copied from interface:SessionFactoryBuilder
Specifies a Bean ValidationValidatorFactory
.- Specified by:
applyValidatorFactory
in interfaceSessionFactoryBuilder
- Parameters:
validatorFactory
- The Bean ValidationValidatorFactory
to use- Returns:
this
, for method chaining- See Also:
-
applyName
Description copied from interface:SessionFactoryBuilder
Specifies a name for theSessionFactory
.- Specified by:
applyName
in interfaceSessionFactoryBuilder
- Parameters:
sessionFactoryName
- The name to use- Returns:
this
, for method chaining- See Also:
-
applyNameAsJndiName
Description copied from interface:SessionFactoryBuilder
Specifies that theSessionFactory
should be registered in JNDI, under the name specified usingSessionFactoryBuilder.applyName(String)
.- Specified by:
applyNameAsJndiName
in interfaceSessionFactoryBuilder
- Parameters:
isJndiName
-true
indicates that the name specified inSessionFactoryBuilder.applyName(java.lang.String)
will be used for binding the SessionFactory into JNDI.- Returns:
this
, for method chaining- See Also:
-
applyAutoClosing
Description copied from interface:SessionFactoryBuilder
Specifies whetherSession
s should be automatically closed at the end of the transaction.- Specified by:
applyAutoClosing
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates they should be auto-closed;false
indicates not.- Returns:
this
, for method chaining- See Also:
-
applyAutoFlushing
Description copied from interface:SessionFactoryBuilder
Applies whetherSession
s should be automatically flushed at the end of the transaction.- Specified by:
applyAutoFlushing
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates they should be auto-flushed;false
indicates not.- Returns:
this
, for method chaining- See Also:
-
applyJtaTrackingByThread
Description copied from interface:SessionFactoryBuilder
If using the built-in JTA-basedTransactionCoordinator
orTransactionCoordinatorBuilder
, should it track JTA transactions by thread in an attempt to detect timeouts?- Specified by:
applyJtaTrackingByThread
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates we should track by thread;false
indicates not- Returns:
this
, for method chaining- See Also:
-
applyPreferUserTransactions
Description copied from interface:SessionFactoryBuilder
If using the built-in JTA-basedTransactionCoordinator
orTransactionCoordinatorBuilder
, should it prefer to useUserTransaction
in preference toTransaction
?- Specified by:
applyPreferUserTransactions
in interfaceSessionFactoryBuilder
- Parameters:
preferUserTransactions
-true
indicates we should preferUserTransaction
;false
indicates we should preferTransaction
- Returns:
this
, for method chaining- See Also:
-
applyStatisticsSupport
Description copied from interface:SessionFactoryBuilder
Specifies whether statistics gathering is enabled.- Specified by:
applyStatisticsSupport
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates that statistics gathering should be enabled;false
indicates not.- Returns:
this
, for method chaining- See Also:
-
addSessionFactoryObservers
Description copied from interface:SessionFactoryBuilder
Specifies one or more observers. May be called multiple times to add additional observers.- Specified by:
addSessionFactoryObservers
in interfaceSessionFactoryBuilder
- Parameters:
observers
- The observers to add- Returns:
this
, for method chaining- See Also:
-
applyInterceptor
Description copied from interface:SessionFactoryBuilder
Specifies anInterceptor
associated with theSessionFactory
, which will be used by all sessions unless an interceptor is explicitly specified usingSessionBuilder.interceptor(org.hibernate.Interceptor)
.- Specified by:
applyInterceptor
in interfaceSessionFactoryBuilder
- Parameters:
interceptor
- The interceptor- Returns:
this
, for method chaining- See Also:
-
applyStatelessInterceptor
public SessionFactoryBuilder applyStatelessInterceptor(Class<? extends Interceptor> statelessInterceptorClass) Description copied from interface:SessionFactoryBuilder
Specifies an interceptorClass
associated with theSessionFactory
, which is used to instantiate a new interceptor for each session, unless an interceptor is explicitly specified usingSessionBuilder.interceptor(org.hibernate.Interceptor)
.- Specified by:
applyStatelessInterceptor
in interfaceSessionFactoryBuilder
- Parameters:
statelessInterceptorClass
- The interceptor class- Returns:
this
, for method chaining- See Also:
-
applyStatelessInterceptor
public SessionFactoryBuilder applyStatelessInterceptor(Supplier<? extends Interceptor> statelessInterceptorSupplier) Description copied from interface:SessionFactoryBuilder
Specifies an interceptorSupplier
associated with theSessionFactory
, which is used to obtain an interceptor for each session, unless an interceptor is explicitly specified usingSessionBuilder.interceptor(org.hibernate.Interceptor)
.- Specified by:
applyStatelessInterceptor
in interfaceSessionFactoryBuilder
- Parameters:
statelessInterceptorSupplier
-Supplier
instance which is used to retrieve the interceptor- Returns:
this
, for method chaining- See Also:
-
applyStatementInspector
Description copied from interface:SessionFactoryBuilder
Specifies aStatementInspector
associated with theSessionFactory
, which will be used by all sessions unless a statement inspector is explicitly specified usingSessionBuilder.statementInspector(org.hibernate.resource.jdbc.spi.StatementInspector)
- Specified by:
applyStatementInspector
in interfaceSessionFactoryBuilder
- Parameters:
statementInspector
- The StatementInspector- Returns:
this
, for method chaining- See Also:
-
applyCustomEntityDirtinessStrategy
public SessionFactoryBuilder applyCustomEntityDirtinessStrategy(CustomEntityDirtinessStrategy strategy) Description copied from interface:SessionFactoryBuilder
Specifies aCustomEntityDirtinessStrategy
.- Specified by:
applyCustomEntityDirtinessStrategy
in interfaceSessionFactoryBuilder
- Parameters:
strategy
- The custom strategy to be used.- Returns:
this
, for method chaining- See Also:
-
addEntityNameResolver
Description copied from interface:SessionFactoryBuilder
Specifies one or more entity name resolvers. May be called multiple times to add additional resolvers.- Specified by:
addEntityNameResolver
in interfaceSessionFactoryBuilder
- Parameters:
entityNameResolvers
- The entityNameResolvers to add- Returns:
this
, for method chaining
-
applyEntityNotFoundDelegate
public SessionFactoryBuilder applyEntityNotFoundDelegate(EntityNotFoundDelegate entityNotFoundDelegate) Description copied from interface:SessionFactoryBuilder
Specifies anEntityNotFoundDelegate
. AnEntityNotFoundDelegate
is a strategy that accounts for different exceptions thrown between Hibernate and JPA when an entity cannot be found.- Specified by:
applyEntityNotFoundDelegate
in interfaceSessionFactoryBuilder
- Parameters:
entityNotFoundDelegate
- The delegate/strategy to use.- Returns:
this
, for method chaining
-
applyIdentifierRollbackSupport
Description copied from interface:SessionFactoryBuilder
Should the generated identifier be "unset" when an entity is deleted?- Specified by:
applyIdentifierRollbackSupport
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates identifiers should be unset;false
indicates not.- Returns:
this
, for method chaining- See Also:
-
applyNullabilityChecking
Description copied from interface:SessionFactoryBuilder
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?- Specified by:
applyNullabilityChecking
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates that Hibernate should perform nullness checking;false
indicates it should not.- Returns:
this
, for method chaining- See Also:
-
applyLazyInitializationOutsideTransaction
Description copied from interface:SessionFactoryBuilder
Should the application be allowed to initialize uninitialized lazy state outside the bounds of a transaction?- Specified by:
applyLazyInitializationOutsideTransaction
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates initialization outside the transaction should be allowed;false
indicates it should not.- Returns:
this
, for method chaining- See Also:
-
applyTempTableDdlTransactionHandling
public SessionFactoryBuilder applyTempTableDdlTransactionHandling(TempTableDdlTransactionHandling handling) Description copied from interface:SessionFactoryBuilder
Specifies how temporary tables should be created or dropped with respect to transaction handling.- Specified by:
applyTempTableDdlTransactionHandling
in interfaceSessionFactoryBuilder
- See Also:
-
applyDelayedEntityLoaderCreations
Description copied from interface:SessionFactoryBuilder
Should entity loaders be generated immediately? Or should the creation be delayed until first need?- Specified by:
applyDelayedEntityLoaderCreations
in interfaceSessionFactoryBuilder
- See Also:
-
applyDefaultBatchFetchSize
Description copied from interface:SessionFactoryBuilder
Specifies a default batch fetch size for all entities and collections which do not otherwise specify a batch fetch size.- Specified by:
applyDefaultBatchFetchSize
in interfaceSessionFactoryBuilder
- Parameters:
size
- The size to use for batch fetching for entities/collections which do not specify an explicit batch fetch size.- Returns:
this
, for method chaining- See Also:
-
applyMaximumFetchDepth
Description copied from interface:SessionFactoryBuilder
Apply a limit to the depth Hibernate will use for outer joins.Note that this is different to an overall limit on the number of joins.
- Specified by:
applyMaximumFetchDepth
in interfaceSessionFactoryBuilder
- Parameters:
depth
- The depth for limiting joins.- Returns:
this
, for method chaining- See Also:
-
applySubselectFetchEnabled
Description copied from interface:SessionFactoryBuilder
Enable the use of subselect fetching.- Specified by:
applySubselectFetchEnabled
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates that subselect fetching is enabled- Returns:
this
, for method chaining- See Also:
-
applyDefaultNullPrecedence
Description copied from interface:SessionFactoryBuilder
Apply a null precedence,NULLS FIRST
orNULLS LAST
, toorder by
clauses rendered in SQL queries.- Specified by:
applyDefaultNullPrecedence
in interfaceSessionFactoryBuilder
- Parameters:
nullPrecedence
- The default null precedence to use.- Returns:
this
, for method chaining- See Also:
-
applyOrderingOfInserts
Description copied from interface:SessionFactoryBuilder
Specify whether ordering of inserts should be enabled.This allows more efficient SQL execution via the use of batching for the inserts; the cost is that the determination of the ordering is far less efficient than not ordering.
- Specified by:
applyOrderingOfInserts
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates that ordering should be enabled;false
indicates not- Returns:
this
, for method chaining- See Also:
-
applyOrderingOfUpdates
Description copied from interface:SessionFactoryBuilder
Specify whether ordering of updates should be enabled.This allows more efficient SQL execution via the use of batching for the updates; the cost is that the determination of the ordering is far less efficient than not ordering.
- Specified by:
applyOrderingOfUpdates
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates that ordering should be enabled;false
indicates not- Returns:
this
, for method chaining- See Also:
-
applyMultiTenancy
Description copied from interface:SessionFactoryBuilder
Specifies whether multitenancy is enabled via use of aMultiTenantConnectionProvider
.Note that this setting does not affect discriminator-based multitenancy.
- Specified by:
applyMultiTenancy
in interfaceSessionFactoryBuilder
- Parameters:
enabled
- True if multi-tenancy in use via aMultiTenantConnectionProvider
.- Returns:
this
, for method chaining- See Also:
-
applyCurrentTenantIdentifierResolver
public SessionFactoryBuilder applyCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver<?> resolver) Description copied from interface:SessionFactoryBuilder
Specifies aCurrentTenantIdentifierResolver
that is responsible for resolving the current tenant identifier.- Specified by:
applyCurrentTenantIdentifierResolver
in interfaceSessionFactoryBuilder
- Parameters:
resolver
- The resolution strategy to use.- Returns:
this
, for method chaining- See Also:
-
applyNamedQueryCheckingOnStartup
Description copied from interface:SessionFactoryBuilder
Should named queries be checked on startup?- Specified by:
applyNamedQueryCheckingOnStartup
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates that they should;false
indicates they should not.- Returns:
this
, for method chaining- See Also:
-
applySecondLevelCacheSupport
Description copied from interface:SessionFactoryBuilder
Should second level caching support be enabled?- Specified by:
applySecondLevelCacheSupport
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates we should enable the use of second level caching;false
indicates we should disable the use of second level caching.- Returns:
this
, for method chaining- See Also:
-
applyQueryCacheSupport
Description copied from interface:SessionFactoryBuilder
Should second level query caching support be enabled?- Specified by:
applyQueryCacheSupport
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates we should enable the use of second level query caching;false
indicates we should disable the use of second level query caching.- Returns:
this
, for method chaining- See Also:
-
applyQueryCacheLayout
Description copied from interface:SessionFactoryBuilder
Specifies the defaultCacheLayout
to use for query cache entries.- Specified by:
applyQueryCacheLayout
in interfaceSessionFactoryBuilder
- Parameters:
cacheLayout
- The cache layout to use.- Returns:
this
, for method chaining- See Also:
-
applyTimestampsCacheFactory
Description copied from interface:SessionFactoryBuilder
Specifies aTimestampsCacheFactory
.- Specified by:
applyTimestampsCacheFactory
in interfaceSessionFactoryBuilder
- Parameters:
factory
- TheTimestampsCacheFactory
to use- Returns:
this
, for method chaining- See Also:
-
applyCacheRegionPrefix
Description copied from interface:SessionFactoryBuilder
Specify a prefix to prepended to all cache region names.- Specified by:
applyCacheRegionPrefix
in interfaceSessionFactoryBuilder
- Parameters:
prefix
- The prefix.- Returns:
this
, for method chaining- See Also:
-
applyMinimalPutsForCaching
Description copied from interface:SessionFactoryBuilder
By default, Hibernate will always just push data into the cache without first checking if that data already exists. For some caches (mainly distributed caches) this can have a major adverse performance impact. For these caches, it is best to enable this "minimal puts" feature.Cache integrations also report whether "minimal puts" should be enabled by default. So it's very rare that users need to set this, generally speaking.
- Specified by:
applyMinimalPutsForCaching
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-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.- Returns:
this
, for method chaining- See Also:
-
applyStructuredCacheEntries
Description copied from interface:SessionFactoryBuilder
By default, Hibernate stores data in the cache in its own optimized format. However, that format is impossible to "read" if browsing the cache. The use of "structured" cache entries allows the cached data to be read.- Specified by:
applyStructuredCacheEntries
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates that structured (human-readable) cache entries should be used;false
indicates that the native entry structure should be used.- Returns:
this
, for method chaining- See Also:
-
applyDirectReferenceCaching
Description copied from interface:SessionFactoryBuilder
Generally, Hibernate will extract the information from an entity and put that extracted information into the second-level cache. This is by far the safest way to second-level cache persistent data. However, there are some cases where it is safe to cache the entity instance directly. This setting controls whether that is used in those cases.- Specified by:
applyDirectReferenceCaching
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-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.- Returns:
this
, for method chaining- See Also:
-
applyAutomaticEvictionOfCollectionCaches
Description copied from interface:SessionFactoryBuilder
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). However, in this case, if the user forgets to manage the one-to-many side stale data can be left in the second-level cache.Warning: enabling this will have a performance impact. Hence why it is disabled by default (for good citizens) and is an opt-in setting.
- Specified by:
applyAutomaticEvictionOfCollectionCaches
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates that these collection caches should be evicted automatically.- Returns:
this
, for method chaining- See Also:
-
applyJdbcBatchSize
Description copied from interface:SessionFactoryBuilder
Specifies the maximum number of statements to batch together in a JDBC batch for insert, update and delete operations. A non-zero number enables batching, but really only a number greater than zero will have any effect. If used, a number great than 5 is suggested.- Specified by:
applyJdbcBatchSize
in interfaceSessionFactoryBuilder
- Parameters:
size
- The batch size to use.- Returns:
this
, for method chaining- See Also:
-
applyJdbcBatchingForVersionedEntities
Description copied from interface:SessionFactoryBuilder
This setting controls whether versioned entities will be included in JDBC batching. The reason being that some JDBC drivers have a problems returning "accurate" update counts from batch statements. This is setting isfalse
by default.- Specified by:
applyJdbcBatchingForVersionedEntities
in interfaceSessionFactoryBuilder
- Parameters:
enabled
- The batch size to use.- Returns:
this
, for method chaining- See Also:
-
applyScrollableResultsSupport
Description copied from interface:SessionFactoryBuilder
Should scrollable results be supported in queries? We ask the JDBC driver whether it supports scrollable result sets as the default for this setting, but some drivers do not accurately report this via DatabaseMetaData. Also, needed if user is supplying connections (and so no Connection is available when we bootstrap).- Specified by:
applyScrollableResultsSupport
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
to enable this support,false
to disable it- Returns:
this
, for method chaining- See Also:
-
applyGetGeneratedKeysSupport
Description copied from interface:SessionFactoryBuilder
Should JDBCStatement.getGeneratedKeys()
feature be used for retrieval of *insert-generated* ids?- Specified by:
applyGetGeneratedKeysSupport
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates we should use JDBC getGeneratedKeys support;false
indicates we should not.- Returns:
this
, for method chaining- See Also:
-
applyJdbcFetchSize
Description copied from interface:SessionFactoryBuilder
Apply a fetch size to the JDBC driver for fetching results.- Specified by:
applyJdbcFetchSize
in interfaceSessionFactoryBuilder
- Parameters:
size
- The fetch size to be passed to the driver.- Returns:
this
, for method chaining- See Also:
-
applyConnectionHandlingMode
public SessionFactoryBuilder applyConnectionHandlingMode(PhysicalConnectionHandlingMode connectionHandlingMode) Description copied from interface:SessionFactoryBuilder
Specifies the connection handling mode for JDBC connections.- Specified by:
applyConnectionHandlingMode
in interfaceSessionFactoryBuilder
- Parameters:
connectionHandlingMode
- The handling mode to apply- Returns:
this
, for method chaining- See Also:
-
applyConnectionProviderDisablesAutoCommit
public SessionFactoryBuilder applyConnectionProviderDisablesAutoCommit(boolean providerDisablesAutoCommit) - Specified by:
applyConnectionProviderDisablesAutoCommit
in interfaceSessionFactoryBuilder
- See Also:
-
applySqlComments
Description copied from interface:SessionFactoryBuilder
Should Hibernate apply comments to SQL it generates?- Specified by:
applySqlComments
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
indicates comments should be applied;false
indicates not.- Returns:
this
, for method chaining- See Also:
-
applySqlFunction
public SessionFactoryBuilder applySqlFunction(String registrationName, SqmFunctionDescriptor functionDescriptor) Description copied from interface:SessionFactoryBuilder
Register aSQL function
with the underlyingSqmFunctionRegistry
.- Specified by:
applySqlFunction
in interfaceSessionFactoryBuilder
- Parameters:
registrationName
- The function name to register it underfunctionDescriptor
- TheSqmFunctionDescriptor
- Returns:
this
, for method chaining
-
applyCollectionsInDefaultFetchGroup
Description copied from interface:SessionFactoryBuilder
Should collections be included in the default fetch group when bytecode enhancement is used?- Specified by:
applyCollectionsInDefaultFetchGroup
in interfaceSessionFactoryBuilder
- Parameters:
enabled
-true
collections should be included,false
they should not. Default istrue
.- Returns:
this
, for method chaining
-
allowOutOfTransactionUpdateOperations
- Specified by:
allowOutOfTransactionUpdateOperations
in interfaceSessionFactoryBuilder
- See Also:
-
enableReleaseResourcesOnCloseEnabled
Description copied from interface:SessionFactoryBuilder
Should resources held by anEntityManager
be released immediately on close?The other option is to release them as part of an after transaction callback.
- Specified by:
enableReleaseResourcesOnCloseEnabled
in interfaceSessionFactoryBuilder
-
enableJpaQueryCompliance
- Specified by:
enableJpaQueryCompliance
in interfaceSessionFactoryBuilder
- See Also:
-
enableJpaOrderByMappingCompliance
- Specified by:
enableJpaOrderByMappingCompliance
in interfaceSessionFactoryBuilder
- See Also:
-
enableJpaTransactionCompliance
- Specified by:
enableJpaTransactionCompliance
in interfaceSessionFactoryBuilder
- See Also:
-
enableJpaCascadeCompliance
Deprecated.- Specified by:
enableJpaCascadeCompliance
in interfaceSessionFactoryBuilder
- See Also:
-
enableJpaClosedCompliance
- Specified by:
enableJpaClosedCompliance
in interfaceSessionFactoryBuilder
- See Also:
-
applyJsonFormatMapper
Description copied from interface:SessionFactoryBuilder
Specifies aformat mapper
to use for serialization/deserialization of JSON properties.- Specified by:
applyJsonFormatMapper
in interfaceSessionFactoryBuilder
- Parameters:
jsonFormatMapper
- TheFormatMapper
to use.- Returns:
this
, for method chaining- See Also:
-
applyXmlFormatMapper
Description copied from interface:SessionFactoryBuilder
Specifies aformat mapper
to use for serialization/deserialization of XML properties.- Specified by:
applyXmlFormatMapper
in interfaceSessionFactoryBuilder
- Parameters:
xmlFormatMapper
- TheFormatMapper
to use.- Returns:
this
, for method chaining- See Also:
-
disableJtaTransactionAccess
public void disableJtaTransactionAccess()Description copied from interface:SessionFactoryBuilderImplementor
Called ifTransactionSettings.ALLOW_JTA_TRANSACTION_ACCESS
is not enabled.- Specified by:
disableJtaTransactionAccess
in interfaceSessionFactoryBuilderImplementor
-
build
Description copied from interface:SessionFactoryBuilder
After all options have been set, build the SessionFactory.- Specified by:
build
in interfaceSessionFactoryBuilder
- Returns:
- The built SessionFactory.
-
buildSessionFactoryOptions
Description copied from interface:SessionFactoryBuilderImplementor
Build theSessionFactoryOptions
that will ultimately be passed to the constructor ofSessionFactoryImpl
.- Specified by:
buildSessionFactoryOptions
in interfaceSessionFactoryBuilderImplementor
-