Package org.hibernate.boot.spi
Interface SessionFactoryOptions
- All Superinterfaces:
QueryEngineOptions
- All Known Implementing Classes:
AbstractDelegatingSessionFactoryOptions
,MockSessionFactory
,ProcessorSessionFactory
,SessionFactoryOptionsBuilder
Aggregator of special options used to build the
SessionFactory
.- Since:
- 5.0
- See Also:
- API Note:
- This type belongs to an SPI package. Due to a historical mistake, it is exposed
via the deprecated method
SessionFactory.getSessionFactoryOptions()
.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Should JPA entity lifecycle callbacks be processed by theEventEngine
andCallbackRegistry
?boolean
default ValueHandlingMode
int
default String
The default catalog to use in generated SQL when a catalog wasn't specified in the mapping, neither explicitly nor implicitly (see the concept of implicit catalog in XML mapping).default String
The default schema to use in generated SQL when a catalog wasn't specified in the mapping, neither explicitly nor implicitly (see the concept of implicit schema in XML mapping).The default tenant identifier java type to use, in case no explicit tenant identifier property is defined.Get the delegate for handling entity-not-found exception conditions.Get the interceptor to use by default for all sessions opened from this factory.int
The format mapper to use for serializing/deserializing JSON data.default boolean
int
int
int
int
int
int
The number ofQueryStatistics
entries that should be stored byStatistics
.The service registry to use in building the factory.The name to be used for the SessionFactory.Supplier<? extends Interceptor>
Get the interceptor to use by default for all sessions opened from this factory.getUuid()
Get the UUID unique to this SessionFactoryOptions.The format mapper to use for serializing/deserializing XML data.default boolean
boolean
default boolean
Deprecated, for removal: This API element is subject to removal in a future version.with no replacement.boolean
boolean
boolean
default boolean
boolean
default boolean
boolean
boolean
boolean
boolean
boolean
boolean
Should generated identifiers be reset after entity removal?boolean
boolean
boolean
Was building of the SessionFactory initiated through JPA bootstrapping, or through Hibernate's native bootstrapping?default boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
default boolean
Should HQL integer division HQL should produce an integer on Oracle, MySQL, and MariaDB, where the/
operator produces a non-integer.boolean
boolean
Should native queries return JDBC datetime types instead of usingjava.time
types.boolean
boolean
boolean
boolean
boolean
boolean
Is the session factory name also a JNDI name, indicating we should bind it into JNDI?boolean
boolean
boolean
boolean
boolean
Controls whether Hibernate should try to map named parameter names specified in aProcedureCall
orStoredProcedureQuery
to named parameters in the JDBCCallableStatement
.boolean
Whether to use the legacy format for serializing/deserializing XML data.default boolean
void
setCheckNullability
(boolean enabled) Allows use of Bean Validation to disable null checking.Methods inherited from interface org.hibernate.query.spi.QueryEngineOptions
getCustomHqlTranslator, getCustomSqlFunctionMap, getCustomSqmFunctionRegistry, getCustomSqmMultiTableInsertStrategy, getCustomSqmMultiTableMutationStrategy, getCustomSqmTranslatorFactory, getImmutableEntityUpdateQueryHandlingMode
-
Method Details
-
getUuid
String getUuid()Get the UUID unique to this SessionFactoryOptions. Will be the same value available asSessionFactoryImplementor.getUuid()
.- Specified by:
getUuid
in interfaceQueryEngineOptions
- Returns:
- The UUID for this SessionFactory.
- See Also:
- API Note:
- The value is generated as a
UUID
, but kept as a String.
-
getServiceRegistry
StandardServiceRegistry getServiceRegistry()The service registry to use in building the factory.- Returns:
- The service registry to use.
-
getBeanManagerReference
Object getBeanManagerReference() -
getValidatorFactoryReference
Object getValidatorFactoryReference() -
getJpaCompliance
JpaCompliance getJpaCompliance()- Specified by:
getJpaCompliance
in interfaceQueryEngineOptions
- See Also:
-
isJpaBootstrap
boolean isJpaBootstrap()Was building of the SessionFactory initiated through JPA bootstrapping, or through Hibernate's native bootstrapping?- Returns:
true
indicates the SessionFactory was built through JPA bootstrapping;false
indicates it was built through native bootstrapping.
-
isAllowRefreshDetachedEntity
Deprecated, for removal: This API element is subject to removal in a future version.with no replacement. -
getSessionFactoryName
String getSessionFactoryName()The name to be used for the SessionFactory. This is used during in-VM serialization; seeSessionFactoryRegistry
. May also be used as a JNDI name depending on "hibernate.session_factory_jndi_name" and "hibernate.session_factory_name_is_jndi".- Specified by:
getSessionFactoryName
in interfaceQueryEngineOptions
- Returns:
- The session factory name
- See Also:
-
isSessionFactoryNameAlsoJndiName
Boolean isSessionFactoryNameAlsoJndiName()Is the session factory name also a JNDI name, indicating we should bind it into JNDI?- Returns:
true
if the SessionFactory name is also a JNDI name;false
otherwise.- See Also:
-
isStatisticsEnabled
boolean isStatisticsEnabled()- See Also:
-
getInterceptor
Interceptor getInterceptor()Get the interceptor to use by default for all sessions opened from this factory.- Returns:
- The interceptor to use factory wide. May be
null
- See Also:
-
getStatelessInterceptorImplementorSupplier
Supplier<? extends Interceptor> getStatelessInterceptorImplementorSupplier()Get the interceptor to use by default for all sessions opened from this factory.- Returns:
- The interceptor to use factory wide. May be
null
- See Also:
-
getStatementInspector
StatementInspector getStatementInspector()- See Also:
-
getSessionFactoryObservers
SessionFactoryObserver[] getSessionFactoryObservers() -
getBaselineSessionEventsListenerBuilder
BaselineSessionEventsListenerBuilder getBaselineSessionEventsListenerBuilder() -
isIdentifierRollbackEnabled
boolean isIdentifierRollbackEnabled()Should generated identifiers be reset after entity removal? -
isCheckNullability
boolean isCheckNullability()- See Also:
-
setCheckNullability
Allows use of Bean Validation to disable null checking. -
isInitializeLazyStateOutsideTransactionsEnabled
boolean isInitializeLazyStateOutsideTransactionsEnabled() -
getTempTableDdlTransactionHandling
TempTableDdlTransactionHandling getTempTableDdlTransactionHandling() -
isDelayBatchFetchLoaderCreationsEnabled
boolean isDelayBatchFetchLoaderCreationsEnabled() -
getDefaultBatchFetchSize
int getDefaultBatchFetchSize()- See Also:
-
getMaximumFetchDepth
Integer getMaximumFetchDepth()- See Also:
-
isSubselectFetchEnabled
boolean isSubselectFetchEnabled()- See Also:
-
getDefaultNullPrecedence
Nulls getDefaultNullPrecedence()- See Also:
-
isOrderUpdatesEnabled
boolean isOrderUpdatesEnabled()- See Also:
-
isOrderInsertsEnabled
boolean isOrderInsertsEnabled()- See Also:
-
isMultiTenancyEnabled
boolean isMultiTenancyEnabled() -
getCurrentTenantIdentifierResolver
CurrentTenantIdentifierResolver<Object> getCurrentTenantIdentifierResolver() -
isJtaTrackByThread
boolean isJtaTrackByThread() -
isNamedQueryStartupCheckingEnabled
boolean isNamedQueryStartupCheckingEnabled()- See Also:
-
isSecondLevelCacheEnabled
boolean isSecondLevelCacheEnabled()- See Also:
-
isQueryCacheEnabled
boolean isQueryCacheEnabled()- See Also:
-
getQueryCacheLayout
- See Also:
-
getTimestampsCacheFactory
TimestampsCacheFactory getTimestampsCacheFactory()- See Also:
-
getCacheRegionPrefix
String getCacheRegionPrefix()- See Also:
-
isMinimalPutsEnabled
boolean isMinimalPutsEnabled()- See Also:
-
isStructuredCacheEntriesEnabled
boolean isStructuredCacheEntriesEnabled()- See Also:
-
isDirectReferenceCacheEntriesEnabled
boolean isDirectReferenceCacheEntriesEnabled() -
isAutoEvictCollectionCache
boolean isAutoEvictCollectionCache() -
getSchemaAutoTooling
SchemaAutoTooling getSchemaAutoTooling() -
getJdbcBatchSize
int getJdbcBatchSize()- See Also:
-
isJdbcBatchVersionedData
boolean isJdbcBatchVersionedData()- See Also:
-
isScrollableResultSetsEnabled
boolean isScrollableResultSetsEnabled()- See Also:
-
isGetGeneratedKeysEnabled
boolean isGetGeneratedKeysEnabled()- See Also:
-
getJdbcFetchSize
Integer getJdbcFetchSize()- See Also:
-
getPhysicalConnectionHandlingMode
PhysicalConnectionHandlingMode getPhysicalConnectionHandlingMode()- See Also:
-
doesConnectionProviderDisableAutoCommit
boolean doesConnectionProviderDisableAutoCommit() -
isCommentsEnabled
boolean isCommentsEnabled()- See Also:
-
getCustomEntityDirtinessStrategy
CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy() -
getEntityNameResolvers
EntityNameResolver[] getEntityNameResolvers() -
getEntityNotFoundDelegate
EntityNotFoundDelegate getEntityNotFoundDelegate()Get the delegate for handling entity-not-found exception conditions.Returns
StandardEntityNotFoundDelegate
by default.- Returns:
- The specific
EntityNotFoundDelegate
to use, May benull
-
isFlushBeforeCompletionEnabled
boolean isFlushBeforeCompletionEnabled() -
isAutoCloseSessionEnabled
boolean isAutoCloseSessionEnabled()- See Also:
-
isJtaTransactionAccessEnabled
boolean isJtaTransactionAccessEnabled() -
isPreferUserTransaction
boolean isPreferUserTransaction() -
isAllowOutOfTransactionUpdateOperations
boolean isAllowOutOfTransactionUpdateOperations() -
isReleaseResourcesOnCloseEnabled
boolean isReleaseResourcesOnCloseEnabled()- See Also:
-
getJdbcTimeZone
TimeZone getJdbcTimeZone()- See Also:
-
getCriteriaValueHandlingMode
- Specified by:
getCriteriaValueHandlingMode
in interfaceQueryEngineOptions
- See Also:
-
isCriteriaCopyTreeEnabled
default boolean isCriteriaCopyTreeEnabled()- See Also:
-
getNativeJdbcParametersIgnored
default boolean getNativeJdbcParametersIgnored() -
isFailOnPaginationOverCollectionFetchEnabled
boolean isFailOnPaginationOverCollectionFetchEnabled() -
getDefaultCatalog
The default catalog to use in generated SQL when a catalog wasn't specified in the mapping, neither explicitly nor implicitly (see the concept of implicit catalog in XML mapping).- Returns:
- The default catalog to use.
- See Also:
-
getDefaultSchema
The default schema to use in generated SQL when a catalog wasn't specified in the mapping, neither explicitly nor implicitly (see the concept of implicit schema in XML mapping).- Returns:
- The default schema to use.
- See Also:
-
inClauseParameterPaddingEnabled
default boolean inClauseParameterPaddingEnabled() -
isJsonFunctionsEnabled
default boolean isJsonFunctionsEnabled()- Specified by:
isJsonFunctionsEnabled
in interfaceQueryEngineOptions
- See Also:
-
isXmlFunctionsEnabled
default boolean isXmlFunctionsEnabled()- Specified by:
isXmlFunctionsEnabled
in interfaceQueryEngineOptions
- See Also:
-
isPortableIntegerDivisionEnabled
default boolean isPortableIntegerDivisionEnabled()Should HQL integer division HQL should produce an integer on Oracle, MySQL, and MariaDB, where the/
operator produces a non-integer.- Specified by:
isPortableIntegerDivisionEnabled
in interfaceQueryEngineOptions
- See Also:
-
getQueryStatisticsMaxSize
int getQueryStatisticsMaxSize()The number ofQueryStatistics
entries that should be stored byStatistics
. -
areJPACallbacksEnabled
boolean areJPACallbacksEnabled()Should JPA entity lifecycle callbacks be processed by theEventEngine
andCallbackRegistry
? -
isUseOfJdbcNamedParametersEnabled
boolean isUseOfJdbcNamedParametersEnabled()Controls whether Hibernate should try to map named parameter names specified in aProcedureCall
orStoredProcedureQuery
to named parameters in the JDBCCallableStatement
.As JPA is defined, the use of named parameters is essentially of dubious value since by spec the parameters have to be defined in the order they are defined in the procedure/function declaration - we can always bind them positionally. The whole idea of named parameters for CallableStatement is the ability to bind these in any order, but since we unequivocally know the order anyway binding them via name really gains nothing.
If this is
true
, we still need to make sure the Dialect supports named binding. Setting this tofalse
simply circumvents that check and always performs positional binding.- Returns:
true
indicates we should try to useCallableStatement
named parameters, if the Dialect says it is supported;false
indicates that we should never try to useCallableStatement
named parameters, regardless of what the Dialect says.- See Also:
-
isCollectionsInDefaultFetchGroupEnabled
default boolean isCollectionsInDefaultFetchGroupEnabled() -
isUnownedAssociationTransientCheck
boolean isUnownedAssociationTransientCheck() -
getPreferredSqlTypeCodeForBoolean
-
getPreferredSqlTypeCodeForDuration
-
getPreferredSqlTypeCodeForUuid
- See Also:
-
getPreferredSqlTypeCodeForInstant
-
getPreferredSqlTypeCodeForArray
-
getDefaultTimeZoneStorageStrategy
- See Also:
-
isPreferJavaTimeJdbcTypesEnabled
boolean isPreferJavaTimeJdbcTypesEnabled() -
isPreferNativeEnumTypesEnabled
boolean isPreferNativeEnumTypesEnabled()- See Also:
-
getJsonFormatMapper
The format mapper to use for serializing/deserializing JSON data.- Since:
- 6.0
- See Also:
-
getXmlFormatMapper
The format mapper to use for serializing/deserializing XML data.- Since:
- 6.0.1
- See Also:
-
isXmlFormatMapperLegacyFormatEnabled
Whether to use the legacy format for serializing/deserializing XML data.- Since:
- 7.0
- See Also:
-
getDefaultTenantIdentifierJavaType
The default tenant identifier java type to use, in case no explicit tenant identifier property is defined.- Since:
- 6.4
-
isPassProcedureParameterNames
boolean isPassProcedureParameterNames() -
isPreferJdbcDatetimeTypesInNativeQueriesEnabled
boolean isPreferJdbcDatetimeTypesInNativeQueriesEnabled()Should native queries return JDBC datetime types instead of usingjava.time
types.- Since:
- 7.0
- See Also:
-