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 whetherSessions should be automatically closed at the end of the transaction.applyAutoFlushing(boolean enabled) Applies whetherSessions 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 aCurrentTenantIdentifierResolverthat 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 FIRSTorNULLS LAST, toorder byclauses 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 anInterceptorassociated with theSessionFactory, which will be used by all sessions unless an interceptor is explicitly specified usingSessionBuilder.interceptor(org.hibernate.Interceptor).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 mapperto use for serialization/deserialization of JSON properties.applyJtaTrackingByThread(boolean enabled) If using the built-in JTA-basedTransactionCoordinatororTransactionCoordinatorBuilder, 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 theSessionFactoryshould 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-basedTransactionCoordinatororTransactionCoordinatorBuilder, should it prefer to useUserTransactionin preference toTransaction?applyQueryCacheLayout(CacheLayout cacheLayout) Specifies the defaultCacheLayoutto 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 functionwith the underlyingSqmFunctionRegistry.applyStatelessInterceptor(Class<? extends Interceptor> statelessInterceptorClass) Specifies an interceptorClassassociated 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 interceptorSupplierassociated 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 aStatementInspectorassociated with theSessionFactory, which will be used by all sessions unless a statement inspector is explicitly specified usingSessionBuilder.statementInspector(java.util.function.UnaryOperator<java.lang.String>)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.Deprecated.applyTenantSchemaMapper(TenantSchemaMapper<?> mapper) Specifies aTenantSchemaMapperthat is responsible for mapping the current tenant identifier to the name of a database schema.Specifies aTimestampsCacheFactory.applyValidatorFactory(Object validatorFactory) Specifies a Bean ValidationValidatorFactory.applyXmlFormatMapper(FormatMapper xmlFormatMapper) Specifies aformat mapperto use for serialization/deserialization of XML properties.build()After all options have been set, build the SessionFactory.Build theSessionFactoryOptionsthat will ultimately be passed to the constructor ofSessionFactoryImpl.voidCalled ifTransactionSettings.ALLOW_JTA_TRANSACTION_ACCESSis not enabled.enableJpaCascadeCompliance(boolean enabled) Deprecated.enableJpaClosedCompliance(boolean enabled) enableJpaOrderByMappingCompliance(boolean enabled) enableJpaQueryCompliance(boolean enabled) enableJpaTransactionCompliance(boolean enabled) enableReleaseResourcesOnCloseEnabled(boolean enable) Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:SessionFactoryBuilderSpecifies a CDIBeanManager.- Specified by:
applyBeanManagerin interfaceSessionFactoryBuilder- Parameters:
beanManager- The CDIBeanManagerto use- Returns:
this, for method chaining- See Also:
-
applyValidatorFactory
Description copied from interface:SessionFactoryBuilderSpecifies a Bean ValidationValidatorFactory.- Specified by:
applyValidatorFactoryin interfaceSessionFactoryBuilder- Parameters:
validatorFactory- The Bean ValidationValidatorFactoryto use- Returns:
this, for method chaining- See Also:
-
applyName
Description copied from interface:SessionFactoryBuilderSpecifies a name for theSessionFactory.- Specified by:
applyNamein interfaceSessionFactoryBuilder- Parameters:
sessionFactoryName- The name to use- Returns:
this, for method chaining- See Also:
-
applyNameAsJndiName
Description copied from interface:SessionFactoryBuilderSpecifies that theSessionFactoryshould be registered in JNDI, under the name specified usingSessionFactoryBuilder.applyName(String).- Specified by:
applyNameAsJndiNamein interfaceSessionFactoryBuilder- Parameters:
isJndiName-trueindicates 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:SessionFactoryBuilderSpecifies whetherSessions should be automatically closed at the end of the transaction.- Specified by:
applyAutoClosingin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates they should be auto-closed;falseindicates not.- Returns:
this, for method chaining- See Also:
-
applyAutoFlushing
Description copied from interface:SessionFactoryBuilderApplies whetherSessions should be automatically flushed at the end of the transaction.- Specified by:
applyAutoFlushingin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates they should be auto-flushed;falseindicates not.- Returns:
this, for method chaining- See Also:
-
applyJtaTrackingByThread
Description copied from interface:SessionFactoryBuilderIf using the built-in JTA-basedTransactionCoordinatororTransactionCoordinatorBuilder, should it track JTA transactions by thread in an attempt to detect timeouts?- Specified by:
applyJtaTrackingByThreadin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates we should track by thread;falseindicates not- Returns:
this, for method chaining- See Also:
-
applyPreferUserTransactions
Description copied from interface:SessionFactoryBuilderIf using the built-in JTA-basedTransactionCoordinatororTransactionCoordinatorBuilder, should it prefer to useUserTransactionin preference toTransaction?- Specified by:
applyPreferUserTransactionsin interfaceSessionFactoryBuilder- Parameters:
preferUserTransactions-trueindicates we should preferUserTransaction;falseindicates we should preferTransaction- Returns:
this, for method chaining- See Also:
-
applyStatisticsSupport
Description copied from interface:SessionFactoryBuilderSpecifies whether statistics gathering is enabled.- Specified by:
applyStatisticsSupportin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates that statistics gathering should be enabled;falseindicates not.- Returns:
this, for method chaining- See Also:
-
addSessionFactoryObservers
Description copied from interface:SessionFactoryBuilderSpecifies one or more observers. May be called multiple times to add additional observers.- Specified by:
addSessionFactoryObserversin interfaceSessionFactoryBuilder- Parameters:
observers- The observers to add- Returns:
this, for method chaining- See Also:
-
applyInterceptor
Description copied from interface:SessionFactoryBuilderSpecifies anInterceptorassociated with theSessionFactory, which will be used by all sessions unless an interceptor is explicitly specified usingSessionBuilder.interceptor(org.hibernate.Interceptor).- Specified by:
applyInterceptorin interfaceSessionFactoryBuilder- Parameters:
interceptor- The interceptor- Returns:
this, for method chaining- See Also:
-
applyStatelessInterceptor
public SessionFactoryBuilder applyStatelessInterceptor(Class<? extends Interceptor> statelessInterceptorClass) Description copied from interface:SessionFactoryBuilderSpecifies an interceptorClassassociated 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:
applyStatelessInterceptorin 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:SessionFactoryBuilderSpecifies an interceptorSupplierassociated 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:
applyStatelessInterceptorin interfaceSessionFactoryBuilder- Parameters:
statelessInterceptorSupplier-Supplierinstance which is used to retrieve the interceptor- Returns:
this, for method chaining- See Also:
-
applyStatementInspector
Description copied from interface:SessionFactoryBuilderSpecifies aStatementInspectorassociated with theSessionFactory, which will be used by all sessions unless a statement inspector is explicitly specified usingSessionBuilder.statementInspector(java.util.function.UnaryOperator<java.lang.String>)- Specified by:
applyStatementInspectorin interfaceSessionFactoryBuilder- Parameters:
statementInspector- The StatementInspector- Returns:
this, for method chaining- See Also:
-
applyCustomEntityDirtinessStrategy
public SessionFactoryBuilder applyCustomEntityDirtinessStrategy(CustomEntityDirtinessStrategy strategy) Description copied from interface:SessionFactoryBuilderSpecifies aCustomEntityDirtinessStrategy.- Specified by:
applyCustomEntityDirtinessStrategyin interfaceSessionFactoryBuilder- Parameters:
strategy- The custom strategy to be used.- Returns:
this, for method chaining- See Also:
-
addEntityNameResolver
Description copied from interface:SessionFactoryBuilderSpecifies one or more entity name resolvers. May be called multiple times to add additional resolvers.- Specified by:
addEntityNameResolverin interfaceSessionFactoryBuilder- Parameters:
entityNameResolvers- The entityNameResolvers to add- Returns:
this, for method chaining
-
applyEntityNotFoundDelegate
public SessionFactoryBuilder applyEntityNotFoundDelegate(EntityNotFoundDelegate entityNotFoundDelegate) Description copied from interface:SessionFactoryBuilderSpecifies anEntityNotFoundDelegate. AnEntityNotFoundDelegateis a strategy that accounts for different exceptions thrown between Hibernate and JPA when an entity cannot be found.- Specified by:
applyEntityNotFoundDelegatein interfaceSessionFactoryBuilder- Parameters:
entityNotFoundDelegate- The delegate/strategy to use.- Returns:
this, for method chaining
-
applyIdentifierRollbackSupport
Description copied from interface:SessionFactoryBuilderShould the generated identifier be "unset" when an entity is deleted?- Specified by:
applyIdentifierRollbackSupportin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates identifiers should be unset;falseindicates not.- Returns:
this, for method chaining- See Also:
-
applyNullabilityChecking
Description copied from interface:SessionFactoryBuilderShould 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:
applyNullabilityCheckingin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates that Hibernate should perform nullness checking;falseindicates it should not.- Returns:
this, for method chaining- See Also:
-
applyLazyInitializationOutsideTransaction
Description copied from interface:SessionFactoryBuilderShould the application be allowed to initialize uninitialized lazy state outside the bounds of a transaction?- Specified by:
applyLazyInitializationOutsideTransactionin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates initialization outside the transaction should be allowed;falseindicates it should not.- Returns:
this, for method chaining- See Also:
-
applyTempTableDdlTransactionHandling
@Deprecated public SessionFactoryBuilder applyTempTableDdlTransactionHandling(TempTableDdlTransactionHandling handling) Deprecated.Description copied from interface:SessionFactoryBuilderSpecifies how temporary tables should be created or dropped with respect to transaction handling.- Specified by:
applyTempTableDdlTransactionHandlingin interfaceSessionFactoryBuilder- See Also:
-
applyDelayedEntityLoaderCreations
Description copied from interface:SessionFactoryBuilderShould entity loaders be generated immediately? Or should the creation be delayed until first need?- Specified by:
applyDelayedEntityLoaderCreationsin interfaceSessionFactoryBuilder- See Also:
-
applyDefaultBatchFetchSize
Description copied from interface:SessionFactoryBuilderSpecifies a default batch fetch size for all entities and collections which do not otherwise specify a batch fetch size.- Specified by:
applyDefaultBatchFetchSizein 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:SessionFactoryBuilderApply 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:
applyMaximumFetchDepthin interfaceSessionFactoryBuilder- Parameters:
depth- The depth for limiting joins.- Returns:
this, for method chaining- See Also:
-
applySubselectFetchEnabled
Description copied from interface:SessionFactoryBuilderEnable the use of subselect fetching.- Specified by:
applySubselectFetchEnabledin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates that subselect fetching is enabled- Returns:
this, for method chaining- See Also:
-
applyDefaultNullPrecedence
Description copied from interface:SessionFactoryBuilderApply a null precedence,NULLS FIRSTorNULLS LAST, toorder byclauses rendered in SQL queries.- Specified by:
applyDefaultNullPrecedencein interfaceSessionFactoryBuilder- Parameters:
nullPrecedence- The default null precedence to use.- Returns:
this, for method chaining- See Also:
-
applyOrderingOfInserts
Description copied from interface:SessionFactoryBuilderSpecify 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:
applyOrderingOfInsertsin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates that ordering should be enabled;falseindicates not- Returns:
this, for method chaining- See Also:
-
applyOrderingOfUpdates
Description copied from interface:SessionFactoryBuilderSpecify 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:
applyOrderingOfUpdatesin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates that ordering should be enabled;falseindicates not- Returns:
this, for method chaining- See Also:
-
applyMultiTenancy
Description copied from interface:SessionFactoryBuilderSpecifies whether multitenancy is enabled via use of aMultiTenantConnectionProvider.Note that this setting does not affect discriminator-based multitenancy.
- Specified by:
applyMultiTenancyin 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:SessionFactoryBuilderSpecifies aCurrentTenantIdentifierResolverthat is responsible for resolving the current tenant identifier.- Specified by:
applyCurrentTenantIdentifierResolverin interfaceSessionFactoryBuilder- Parameters:
resolver- The resolution strategy to use.- Returns:
this, for method chaining- See Also:
-
applyTenantSchemaMapper
Description copied from interface:SessionFactoryBuilderSpecifies aTenantSchemaMapperthat is responsible for mapping the current tenant identifier to the name of a database schema.- Specified by:
applyTenantSchemaMapperin interfaceSessionFactoryBuilder- Parameters:
mapper- The mapping strategy to use.- Returns:
this, for method chaining- See Also:
-
applyNamedQueryCheckingOnStartup
Description copied from interface:SessionFactoryBuilderShould named queries be checked on startup?- Specified by:
applyNamedQueryCheckingOnStartupin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates that they should;falseindicates they should not.- Returns:
this, for method chaining- See Also:
-
applySecondLevelCacheSupport
Description copied from interface:SessionFactoryBuilderShould second level caching support be enabled?- Specified by:
applySecondLevelCacheSupportin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates we should enable the use of second level caching;falseindicates we should disable the use of second level caching.- Returns:
this, for method chaining- See Also:
-
applyQueryCacheSupport
Description copied from interface:SessionFactoryBuilderShould second level query caching support be enabled?- Specified by:
applyQueryCacheSupportin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates we should enable the use of second level query caching;falseindicates we should disable the use of second level query caching.- Returns:
this, for method chaining- See Also:
-
applyQueryCacheLayout
Description copied from interface:SessionFactoryBuilderSpecifies the defaultCacheLayoutto use for query cache entries.- Specified by:
applyQueryCacheLayoutin interfaceSessionFactoryBuilder- Parameters:
cacheLayout- The cache layout to use.- Returns:
this, for method chaining- See Also:
-
applyTimestampsCacheFactory
Description copied from interface:SessionFactoryBuilderSpecifies aTimestampsCacheFactory.- Specified by:
applyTimestampsCacheFactoryin interfaceSessionFactoryBuilder- Parameters:
factory- TheTimestampsCacheFactoryto use- Returns:
this, for method chaining- See Also:
-
applyCacheRegionPrefix
Description copied from interface:SessionFactoryBuilderSpecify a prefix to prepended to all cache region names.- Specified by:
applyCacheRegionPrefixin interfaceSessionFactoryBuilder- Parameters:
prefix- The prefix.- Returns:
this, for method chaining- See Also:
-
applyMinimalPutsForCaching
Description copied from interface:SessionFactoryBuilderBy 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:
applyMinimalPutsForCachingin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates Hibernate should first check whether data exists and only push to the cache if it does not already exist.falseindicates to perform the default behavior.- Returns:
this, for method chaining- See Also:
-
applyStructuredCacheEntries
Description copied from interface:SessionFactoryBuilderBy 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:
applyStructuredCacheEntriesin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates that structured (human-readable) cache entries should be used;falseindicates that the native entry structure should be used.- Returns:
this, for method chaining- See Also:
-
applyDirectReferenceCaching
Description copied from interface:SessionFactoryBuilderGenerally, 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:
applyDirectReferenceCachingin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates 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:SessionFactoryBuilderWhen 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:
applyAutomaticEvictionOfCollectionCachesin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates that these collection caches should be evicted automatically.- Returns:
this, for method chaining- See Also:
-
applyJdbcBatchSize
Description copied from interface:SessionFactoryBuilderSpecifies 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:
applyJdbcBatchSizein interfaceSessionFactoryBuilder- Parameters:
size- The batch size to use.- Returns:
this, for method chaining- See Also:
-
applyScrollableResultsSupport
Description copied from interface:SessionFactoryBuilderShould 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:
applyScrollableResultsSupportin interfaceSessionFactoryBuilder- Parameters:
enabled-trueto enable this support,falseto disable it- Returns:
this, for method chaining- See Also:
-
applyGetGeneratedKeysSupport
Description copied from interface:SessionFactoryBuilderShould JDBCStatement.getGeneratedKeys()feature be used for retrieval of *insert-generated* ids?- Specified by:
applyGetGeneratedKeysSupportin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates we should use JDBC getGeneratedKeys support;falseindicates we should not.- Returns:
this, for method chaining- See Also:
-
applyJdbcFetchSize
Description copied from interface:SessionFactoryBuilderApply a fetch size to the JDBC driver for fetching results.- Specified by:
applyJdbcFetchSizein 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:SessionFactoryBuilderSpecifies the connection handling mode for JDBC connections.- Specified by:
applyConnectionHandlingModein interfaceSessionFactoryBuilder- Parameters:
connectionHandlingMode- The handling mode to apply- Returns:
this, for method chaining- See Also:
-
applyConnectionProviderDisablesAutoCommit
public SessionFactoryBuilder applyConnectionProviderDisablesAutoCommit(boolean providerDisablesAutoCommit) - Specified by:
applyConnectionProviderDisablesAutoCommitin interfaceSessionFactoryBuilder- See Also:
-
applySqlComments
Description copied from interface:SessionFactoryBuilderShould Hibernate apply comments to SQL it generates?- Specified by:
applySqlCommentsin interfaceSessionFactoryBuilder- Parameters:
enabled-trueindicates comments should be applied;falseindicates not.- Returns:
this, for method chaining- See Also:
-
applySqlFunction
public SessionFactoryBuilder applySqlFunction(String registrationName, SqmFunctionDescriptor functionDescriptor) Description copied from interface:SessionFactoryBuilderRegister aSQL functionwith the underlyingSqmFunctionRegistry.- Specified by:
applySqlFunctionin interfaceSessionFactoryBuilder- Parameters:
registrationName- The function name to register it underfunctionDescriptor- TheSqmFunctionDescriptor- Returns:
this, for method chaining
-
applyCollectionsInDefaultFetchGroup
Description copied from interface:SessionFactoryBuilderShould collections be included in the default fetch group when bytecode enhancement is used?- Specified by:
applyCollectionsInDefaultFetchGroupin interfaceSessionFactoryBuilder- Parameters:
enabled-truecollections should be included,falsethey should not. Default istrue.- Returns:
this, for method chaining
-
allowOutOfTransactionUpdateOperations
- Specified by:
allowOutOfTransactionUpdateOperationsin interfaceSessionFactoryBuilder- See Also:
-
enableReleaseResourcesOnCloseEnabled
Deprecated.Description copied from interface:SessionFactoryBuilderShould resources held by anEntityManagerbe released immediately on close?The other option is to release them as part of an after transaction callback.
- Specified by:
enableReleaseResourcesOnCloseEnabledin interfaceSessionFactoryBuilder
-
enableJpaQueryCompliance
- Specified by:
enableJpaQueryCompliancein interfaceSessionFactoryBuilder- See Also:
-
enableJpaOrderByMappingCompliance
- Specified by:
enableJpaOrderByMappingCompliancein interfaceSessionFactoryBuilder- See Also:
-
enableJpaTransactionCompliance
- Specified by:
enableJpaTransactionCompliancein interfaceSessionFactoryBuilder- See Also:
-
enableJpaCascadeCompliance
Deprecated.- Specified by:
enableJpaCascadeCompliancein interfaceSessionFactoryBuilder- See Also:
-
enableJpaClosedCompliance
- Specified by:
enableJpaClosedCompliancein interfaceSessionFactoryBuilder- See Also:
-
applyJsonFormatMapper
Description copied from interface:SessionFactoryBuilderSpecifies aformat mapperto use for serialization/deserialization of JSON properties.- Specified by:
applyJsonFormatMapperin interfaceSessionFactoryBuilder- Parameters:
jsonFormatMapper- TheFormatMapperto use.- Returns:
this, for method chaining- See Also:
-
applyXmlFormatMapper
Description copied from interface:SessionFactoryBuilderSpecifies aformat mapperto use for serialization/deserialization of XML properties.- Specified by:
applyXmlFormatMapperin interfaceSessionFactoryBuilder- Parameters:
xmlFormatMapper- TheFormatMapperto use.- Returns:
this, for method chaining- See Also:
-
disableJtaTransactionAccess
public void disableJtaTransactionAccess()Description copied from interface:SessionFactoryBuilderImplementorCalled ifTransactionSettings.ALLOW_JTA_TRANSACTION_ACCESSis not enabled.- Specified by:
disableJtaTransactionAccessin interfaceSessionFactoryBuilderImplementor
-
build
Description copied from interface:SessionFactoryBuilderAfter all options have been set, build the SessionFactory.- Specified by:
buildin interfaceSessionFactoryBuilder- Returns:
- The built SessionFactory.
-
buildSessionFactoryOptions
Description copied from interface:SessionFactoryBuilderImplementorBuild theSessionFactoryOptionsthat will ultimately be passed to the constructor ofSessionFactoryImpl.- Specified by:
buildSessionFactoryOptionsin interfaceSessionFactoryBuilderImplementor
-