Package org.hibernate.boot.spi
Interface SessionFactoryOptions
-
- All Superinterfaces:
QueryEngineOptions
- All Known Implementing Classes:
AbstractDelegatingSessionFactoryOptions,SessionFactoryOptionsBuilder
public interface SessionFactoryOptions extends QueryEngineOptions
Aggregator of special options used to build theSessionFactory.- Since:
- 5.0
-
-
Method Summary
-
Methods inherited from interface org.hibernate.query.spi.QueryEngineOptions
getCustomHqlTranslator, getCustomSqlFunctionMap, getCustomSqmFunctionRegistry, getCustomSqmMultiTableInsertStrategy, getCustomSqmMultiTableMutationStrategy, getCustomSqmTranslatorFactory
-
-
-
-
Method Detail
-
getUuid
String getUuid()
Get the UUID unique to this SessionFactoryOptions. Will be the same value available asSessionFactoryImplementor.getUuid().- Returns:
- The UUID for this SessionFactory.
- See Also:
SessionFactoryRegistry.getSessionFactory(java.lang.String),SessionFactoryImplementor.getUuid()- 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()
-
isJpaBootstrap
boolean isJpaBootstrap()
Was building of the SessionFactory initiated through JPA bootstrapping, or through Hibernate's native bootstrapping?- Returns:
trueindicates the SessionFactory was built through JPA bootstrapping;falseindicates it was built through native bootstrapping.
-
isJtaTransactionAccessEnabled
boolean isJtaTransactionAccessEnabled()
-
isAllowRefreshDetachedEntity
default boolean isAllowRefreshDetachedEntity()
-
getSessionFactoryName
String getSessionFactoryName()
The name to be used for the SessionFactory. This is used both in:- in-VM serialization
- JNDI binding, depending on
isSessionFactoryNameAlsoJndiName()
- Returns:
- The SessionFactory name
-
isSessionFactoryNameAlsoJndiName
boolean isSessionFactoryNameAlsoJndiName()
Is theSesssionFactory namealso a JNDI name, indicating we should bind it into JNDI?- Returns:
trueif the SessionFactory name is also a JNDI name;falseotherwise.
-
isFlushBeforeCompletionEnabled
boolean isFlushBeforeCompletionEnabled()
-
isAutoCloseSessionEnabled
boolean isAutoCloseSessionEnabled()
-
isStatisticsEnabled
boolean isStatisticsEnabled()
-
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
-
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
-
getStatementInspector
StatementInspector getStatementInspector()
-
getSessionFactoryObservers
SessionFactoryObserver[] getSessionFactoryObservers()
-
getBaselineSessionEventsListenerBuilder
BaselineSessionEventsListenerBuilder getBaselineSessionEventsListenerBuilder()
-
isIdentifierRollbackEnabled
boolean isIdentifierRollbackEnabled()
-
isCheckNullability
boolean isCheckNullability()
-
isInitializeLazyStateOutsideTransactionsEnabled
boolean isInitializeLazyStateOutsideTransactionsEnabled()
-
getTempTableDdlTransactionHandling
TempTableDdlTransactionHandling getTempTableDdlTransactionHandling()
-
getBatchFetchStyle
@Deprecated(since="6.0") BatchFetchStyle getBatchFetchStyle()
Deprecated.: No longer used internally
-
isDelayBatchFetchLoaderCreationsEnabled
boolean isDelayBatchFetchLoaderCreationsEnabled()
-
getDefaultBatchFetchSize
int getDefaultBatchFetchSize()
-
getMaximumFetchDepth
Integer getMaximumFetchDepth()
-
getDefaultNullPrecedence
NullPrecedence getDefaultNullPrecedence()
-
isOrderUpdatesEnabled
boolean isOrderUpdatesEnabled()
-
isOrderInsertsEnabled
boolean isOrderInsertsEnabled()
-
isMultiTenancyEnabled
boolean isMultiTenancyEnabled()
-
getCurrentTenantIdentifierResolver
CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
-
isJtaTrackByThread
boolean isJtaTrackByThread()
-
isNamedQueryStartupCheckingEnabled
boolean isNamedQueryStartupCheckingEnabled()
-
isSecondLevelCacheEnabled
boolean isSecondLevelCacheEnabled()
-
isQueryCacheEnabled
boolean isQueryCacheEnabled()
-
getTimestampsCacheFactory
TimestampsCacheFactory getTimestampsCacheFactory()
-
getCacheRegionPrefix
String getCacheRegionPrefix()
-
isMinimalPutsEnabled
boolean isMinimalPutsEnabled()
-
isStructuredCacheEntriesEnabled
boolean isStructuredCacheEntriesEnabled()
-
isDirectReferenceCacheEntriesEnabled
boolean isDirectReferenceCacheEntriesEnabled()
-
isAutoEvictCollectionCache
boolean isAutoEvictCollectionCache()
-
getSchemaAutoTooling
SchemaAutoTooling getSchemaAutoTooling()
-
getJdbcBatchSize
int getJdbcBatchSize()
-
isJdbcBatchVersionedData
boolean isJdbcBatchVersionedData()
-
isScrollableResultSetsEnabled
boolean isScrollableResultSetsEnabled()
-
isGetGeneratedKeysEnabled
boolean isGetGeneratedKeysEnabled()
-
getJdbcFetchSize
Integer getJdbcFetchSize()
-
getPhysicalConnectionHandlingMode
PhysicalConnectionHandlingMode getPhysicalConnectionHandlingMode()
-
doesConnectionProviderDisableAutoCommit
default boolean doesConnectionProviderDisableAutoCommit()
-
isCommentsEnabled
boolean isCommentsEnabled()
-
getCustomEntityDirtinessStrategy
CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
-
getEntityNameResolvers
EntityNameResolver[] getEntityNameResolvers()
-
getEntityNotFoundDelegate
EntityNotFoundDelegate getEntityNotFoundDelegate()
Get the delegate for handling entity-not-found exception conditions.- Returns:
- The specific EntityNotFoundDelegate to use, May be
null
-
setCheckNullability
void setCheckNullability(boolean enabled)
-
isPreferUserTransaction
boolean isPreferUserTransaction()
-
isAllowOutOfTransactionUpdateOperations
boolean isAllowOutOfTransactionUpdateOperations()
-
isReleaseResourcesOnCloseEnabled
boolean isReleaseResourcesOnCloseEnabled()
-
getJdbcTimeZone
TimeZone getJdbcTimeZone()
-
getCriteriaValueHandlingMode
default ValueHandlingMode getCriteriaValueHandlingMode()
- Specified by:
getCriteriaValueHandlingModein interfaceQueryEngineOptions- See Also:
AvailableSettings.CRITERIA_VALUE_HANDLING_MODE
-
isCriteriaCopyTreeEnabled
default boolean isCriteriaCopyTreeEnabled()
- See Also:
AvailableSettings.CRITERIA_COPY_TREE
-
getJpaCompliance
JpaCompliance getJpaCompliance()
- Specified by:
getJpaCompliancein interfaceQueryEngineOptions
-
isFailOnPaginationOverCollectionFetchEnabled
boolean isFailOnPaginationOverCollectionFetchEnabled()
-
getImmutableEntityUpdateQueryHandlingMode
default ImmutableEntityUpdateQueryHandlingMode getImmutableEntityUpdateQueryHandlingMode()
-
getDefaultCatalog
default String 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.
-
getDefaultSchema
default String 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.
-
inClauseParameterPaddingEnabled
default boolean inClauseParameterPaddingEnabled()
-
getQueryStatisticsMaxSize
default int getQueryStatisticsMaxSize()
-
areJPACallbacksEnabled
default boolean areJPACallbacksEnabled()
-
isUseOfJdbcNamedParametersEnabled
boolean isUseOfJdbcNamedParametersEnabled()
Controls whether Hibernate should try to map named parameter names specified in aProcedureCallorStoredProcedureQueryto 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 tofalsesimply circumvents that check and always performs positional binding.- Returns:
trueindicates we should try to useCallableStatementnamed parameters, if the Dialect says it is supported;falseindicates that we should never try to useCallableStatementnamed parameters, regardless of what the Dialect says.- See Also:
AvailableSettings.CALLABLE_NAMED_PARAMS_ENABLED
-
isCollectionsInDefaultFetchGroupEnabled
default boolean isCollectionsInDefaultFetchGroupEnabled()
-
getPreferredSqlTypeCodeForBoolean
@Incubating int getPreferredSqlTypeCodeForBoolean()
-
getPreferredSqlTypeCodeForDuration
@Incubating int getPreferredSqlTypeCodeForDuration()
-
getPreferredSqlTypeCodeForUuid
@Incubating int getPreferredSqlTypeCodeForUuid()
-
getPreferredSqlTypeCodeForInstant
@Incubating int getPreferredSqlTypeCodeForInstant()
-
getPreferredSqlTypeCodeForArray
@Incubating int getPreferredSqlTypeCodeForArray()
-
getDefaultTimeZoneStorageStrategy
@Incubating TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
-
getJsonFormatMapper
@Incubating FormatMapper getJsonFormatMapper()
The format mapper to use for serializing/deserializing JSON data.- Since:
- 6.0
-
getXmlFormatMapper
@Incubating FormatMapper getXmlFormatMapper()
The format mapper to use for serializing/deserializing XML data.- Since:
- 6.0.1
-
-