Top Description Methods
org.hibernate.boot.spi

public Interface SessionFactoryOptions

Known Direct Implementers
org.hibernate.boot.internal.SessionFactoryOptionsBuilder, org.hibernate.boot.spi.AbstractDelegatingSessionFactoryOptions
Imports
java.util.Map, .TimeZone, java.util.function.Supplier, org.hibernate.ConnectionReleaseMode, .CustomEntityDirtinessStrategy, .EntityMode, .EntityNameResolver, .HibernateException, .Interceptor, .MultiTenancyStrategy, .NullPrecedence, .SessionFactoryObserver, org.hibernate.boot.SchemaAutoTooling, .TempTableDdlTransactionHandling, org.hibernate.boot.registry.StandardServiceRegistry, org.hibernate.cache.spi.TimestampsCacheFactory, org.hibernate.cfg.BaselineSessionEventsListenerBuilder, org.hibernate.context.spi.CurrentTenantIdentifierResolver, org.hibernate.dialect.function.SQLFunction, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.hql.spi.id.MultiTableBulkIdStrategy, org.hibernate.jpa.spi.JpaCompliance, org.hibernate.loader.BatchFetchStyle, org.hibernate.proxy.EntityNotFoundDelegate, org.hibernate.query.ImmutableEntityUpdateQueryHandlingMode, org.hibernate.query.criteria.LiteralHandlingMode, org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode, .StatementInspector, org.hibernate.stat.Statistics, org.hibernate.tuple.entity.EntityTuplizerFactory

Aggregator of special options used to build the SessionFactory.
Since
5.0

Method Summary

Modifier and TypeMethod and Description
public default boolean
public default boolean
public BaselineSessionEventsListenerBuilder
public BatchFetchStyle
public Object
public String
public ConnectionReleaseMode
public default LiteralHandlingMode
public CurrentTenantIdentifierResolver
public CustomEntityDirtinessStrategy
public Map<String, SQLFunction>
public int
public default String

Returns:

The default catalog to use.
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).

public EntityMode
public NullPrecedence
public default String

Returns:

The default schema to use.
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).

public EntityNameResolver[]
public EntityNotFoundDelegate

Returns:

The specific EntityNotFoundDelegate to use, May be null
getEntityNotFoundDelegate
()

Get the delegate for handling entity-not-found exception conditions.

public EntityTuplizerFactory
public default ImmutableEntityUpdateQueryHandlingMode
public Interceptor

Returns:

The interceptor to use factory wide. May be null
getInterceptor
()

Get the interceptor to use by default for all sessions opened from this factory.

public int
public Integer
public TimeZone
public JpaCompliance
public Integer
public MultiTableBulkIdStrategy
public MultiTenancyStrategy
public PhysicalConnectionHandlingMode
public default int
public Map<K, V>
public SchemaAutoTooling
public StandardServiceRegistry

Returns:

The service registry to use.
getServiceRegistry
()

The service registry to use in building the factory.

public String

Returns:

The SessionFactory name
getSessionFactoryName
()

The name to be used for the SessionFactory.

public SessionFactoryObserver[]
public Class<? extends Interceptor>

Returns:

The interceptor to use factory wide. May be null
getStatelessInterceptorImplementor
()

Get the interceptor to use by default for all sessions opened from this factory.
public default Supplier<? extends Interceptor>

Returns:

The interceptor to use factory wide. May be null
getStatelessInterceptorImplementorSupplier
()

Get the interceptor to use by default for all sessions opened from this factory.

public StatementInspector
public TempTableDdlTransactionHandling
public TimestampsCacheFactory
public String

Returns:

The UUID for this SessionFactory.
getUuid
()

Get the UUID unique to this SessionFactoryOptions.

public Object
public default boolean
public boolean
public default boolean
public boolean
public boolean
public boolean
public boolean
public default boolean
public boolean
public boolean
public boolean
public boolean
public default boolean
isEnhancementAsProxyEnabled()

Deprecated (since 5.5) use of enhanced proxies is always enabled
Can bytecode-enhanced entity classes be used as a "proxy"?
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

true indicates the SessionFactory was built through JPA bootstrapping; false indicates it was built through native bootstrapping.
isJpaBootstrap
()

Was building of the SessionFactory initiated through JPA bootstrapping, or through Hibernate's native bootstrapping?

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public default boolean
isPostInsertIdentifierDelayableEnabled()

Deprecated Since 5.4.1, this is no longer used.
public boolean
public boolean
public boolean
public default boolean
public boolean
public boolean
public boolean
public boolean

Returns:

true if the SessionFactory name is also a JNDI name; false otherwise.
isSessionFactoryNameAlsoJndiName
()

Is the SesssionFactory name also a JNDI name, indicating we should bind it into JNDI?

public boolean
public default boolean
public boolean
public boolean
isWrapResultSetsEnabled()

Deprecated (since 5.5) Scheduled for removal in 6.0 as ResultSet wrapping is no longer needed
public boolean
public default boolean
public void
setCheckNullability(boolean enabled)

Method Detail

areJPACallbacksEnabledback to summary
public default boolean areJPACallbacksEnabled()
doesConnectionProviderDisableAutoCommitback to summary
public default boolean doesConnectionProviderDisableAutoCommit()
getBaselineSessionEventsListenerBuilderback to summary
public BaselineSessionEventsListenerBuilder getBaselineSessionEventsListenerBuilder()
getBatchFetchStyleback to summary
public BatchFetchStyle getBatchFetchStyle()
getBeanManagerReferenceback to summary
public Object getBeanManagerReference()
getCacheRegionPrefixback to summary
public String getCacheRegionPrefix()
getConnectionReleaseModeback to summary
public ConnectionReleaseMode getConnectionReleaseMode()

Deprecated

Use getPhysicalConnectionHandlingMode() instead

Annotations
@Deprecated
getCriteriaLiteralHandlingModeback to summary
public default LiteralHandlingMode getCriteriaLiteralHandlingMode()
getCurrentTenantIdentifierResolverback to summary
public CurrentTenantIdentifierResolver getCurrentTenantIdentifierResolver()
getCustomEntityDirtinessStrategyback to summary
public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
getCustomSqlFunctionMapback to summary
public Map<String, SQLFunction> getCustomSqlFunctionMap()
getDefaultBatchFetchSizeback to summary
public int getDefaultBatchFetchSize()
getDefaultCatalogback to summary
public 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:String

The default catalog to use.

getDefaultEntityModeback to summary
public EntityMode getDefaultEntityMode()
getDefaultNullPrecedenceback to summary
public NullPrecedence getDefaultNullPrecedence()
getDefaultSchemaback to summary
public 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:String

The default schema to use.

getEntityNameResolversback to summary
public EntityNameResolver[] getEntityNameResolvers()
getEntityNotFoundDelegateback to summary
public EntityNotFoundDelegate getEntityNotFoundDelegate()

Get the delegate for handling entity-not-found exception conditions.

Returns:EntityNotFoundDelegate

The specific EntityNotFoundDelegate to use, May be null

getEntityTuplizerFactoryback to summary
public EntityTuplizerFactory getEntityTuplizerFactory()
getImmutableEntityUpdateQueryHandlingModeback to summary
public default ImmutableEntityUpdateQueryHandlingMode getImmutableEntityUpdateQueryHandlingMode()
getInterceptorback to summary
public Interceptor getInterceptor()

Get the interceptor to use by default for all sessions opened from this factory.

Returns:Interceptor

The interceptor to use factory wide. May be null

getJdbcBatchSizeback to summary
public int getJdbcBatchSize()
getJdbcFetchSizeback to summary
public Integer getJdbcFetchSize()
getJdbcTimeZoneback to summary
public TimeZone getJdbcTimeZone()
getJpaComplianceback to summary
public JpaCompliance getJpaCompliance()
getMaximumFetchDepthback to summary
public Integer getMaximumFetchDepth()
getMultiTableBulkIdStrategyback to summary
public MultiTableBulkIdStrategy getMultiTableBulkIdStrategy()
getMultiTenancyStrategyback to summary
public MultiTenancyStrategy getMultiTenancyStrategy()
getPhysicalConnectionHandlingModeback to summary
public PhysicalConnectionHandlingMode getPhysicalConnectionHandlingMode()
getQueryStatisticsMaxSizeback to summary
public default int getQueryStatisticsMaxSize()
getQuerySubstitutionsback to summary
public Map<K, V> getQuerySubstitutions()
getSchemaAutoToolingback to summary
public SchemaAutoTooling getSchemaAutoTooling()
getServiceRegistryback to summary
public StandardServiceRegistry getServiceRegistry()

The service registry to use in building the factory.

Returns:StandardServiceRegistry

The service registry to use.

getSessionFactoryNameback to summary
public String getSessionFactoryName()

The name to be used for the SessionFactory. This is used both in:

Returns:String

The SessionFactory name

getSessionFactoryObserversback to summary
public SessionFactoryObserver[] getSessionFactoryObservers()
getStatelessInterceptorImplementorback to summary
public Class<? extends Interceptor> getStatelessInterceptorImplementor()

Get the interceptor to use by default for all sessions opened from this factory.

Returns:Class<? extends Interceptor>

The interceptor to use factory wide. May be null

Annotations
@Deprecated
getStatelessInterceptorImplementorSupplierback to summary
public default Supplier<? extends Interceptor> getStatelessInterceptorImplementorSupplier()

Get the interceptor to use by default for all sessions opened from this factory.

Returns:Supplier<? extends Interceptor>

The interceptor to use factory wide. May be null

getStatementInspectorback to summary
public StatementInspector getStatementInspector()
getTempTableDdlTransactionHandlingback to summary
public TempTableDdlTransactionHandling getTempTableDdlTransactionHandling()
getTimestampsCacheFactoryback to summary
public TimestampsCacheFactory getTimestampsCacheFactory()
getUuidback to summary
public String getUuid()

Get the UUID unique to this SessionFactoryOptions. Will be the same value available as SessionFactoryImplementor#getUuid().

API Note

The value is generated as a java.util.UUID, but kept as a String.

Returns:String

The UUID for this SessionFactory.

See Also
org.hibernate.internal.SessionFactoryRegistry#getSessionFactory, SessionFactoryImplementor#getUuid
getValidatorFactoryReferenceback to summary
public Object getValidatorFactoryReference()
inClauseParameterPaddingEnabledback to summary
public default boolean inClauseParameterPaddingEnabled()
isAllowOutOfTransactionUpdateOperationsback to summary
public boolean isAllowOutOfTransactionUpdateOperations()
isAllowRefreshDetachedEntityback to summary
public default boolean isAllowRefreshDetachedEntity()
isAutoCloseSessionEnabledback to summary
public boolean isAutoCloseSessionEnabled()
isAutoEvictCollectionCacheback to summary
public boolean isAutoEvictCollectionCache()
isCheckNullabilityback to summary
public boolean isCheckNullability()
isCollectionJoinSubqueryRewriteEnabledback to summary
public boolean isCollectionJoinSubqueryRewriteEnabled()
isCollectionsInDefaultFetchGroupEnabledback to summary
public default boolean isCollectionsInDefaultFetchGroupEnabled()
isCommentsEnabledback to summary
public boolean isCommentsEnabled()
isConventionalJavaConstantsback to summary
public boolean isConventionalJavaConstants()
isDelayBatchFetchLoaderCreationsEnabledback to summary
public boolean isDelayBatchFetchLoaderCreationsEnabled()
isDirectReferenceCacheEntriesEnabledback to summary
public boolean isDirectReferenceCacheEntriesEnabled()
isEnhancementAsProxyEnabledback to summary
public default boolean isEnhancementAsProxyEnabled()

Deprecated

(since 5.5) use of enhanced proxies is always enabled

Can bytecode-enhanced entity classes be used as a "proxy"?

Annotations
@Deprecated
isFailOnPaginationOverCollectionFetchEnabledback to summary
public boolean isFailOnPaginationOverCollectionFetchEnabled()
isFlushBeforeCompletionEnabledback to summary
public boolean isFlushBeforeCompletionEnabled()
isGetGeneratedKeysEnabledback to summary
public boolean isGetGeneratedKeysEnabled()
isIdentifierRollbackEnabledback to summary
public boolean isIdentifierRollbackEnabled()
isInitializeLazyStateOutsideTransactionsEnabledback to summary
public boolean isInitializeLazyStateOutsideTransactionsEnabled()
isJdbcBatchVersionedDataback to summary
public boolean isJdbcBatchVersionedData()
isJpaBootstrapback to summary
public boolean isJpaBootstrap()

Was building of the SessionFactory initiated through JPA bootstrapping, or through Hibernate's native bootstrapping?

Returns:boolean

true indicates the SessionFactory was built through JPA bootstrapping; false indicates it was built through native bootstrapping.

isJtaTrackByThreadback to summary
public boolean isJtaTrackByThread()
isJtaTransactionAccessEnabledback to summary
public boolean isJtaTransactionAccessEnabled()
isMinimalPutsEnabledback to summary
public boolean isMinimalPutsEnabled()
isNamedQueryStartupCheckingEnabledback to summary
public boolean isNamedQueryStartupCheckingEnabled()
isOmitJoinOfSuperclassTablesEnabledback to summary
public boolean isOmitJoinOfSuperclassTablesEnabled()
isOrderInsertsEnabledback to summary
public boolean isOrderInsertsEnabled()
isOrderUpdatesEnabledback to summary
public boolean isOrderUpdatesEnabled()
isPostInsertIdentifierDelayableEnabledback to summary
public default boolean isPostInsertIdentifierDelayableEnabled()

Deprecated

Since 5.4.1, this is no longer used.

Annotations
@Deprecated
isPreferUserTransactionback to summary
public boolean isPreferUserTransaction()
isProcedureParameterNullPassingEnabledback to summary
public boolean isProcedureParameterNullPassingEnabled()

Deprecated

with no replacement. See org.hibernate.cfg.AvailableSettings#PROCEDURE_NULL_PARAM_PASSING for details

Annotations
@Deprecated
isQueryCacheEnabledback to summary
public boolean isQueryCacheEnabled()
isQueryParametersValidationEnabledback to summary
public default boolean isQueryParametersValidationEnabled()
isReleaseResourcesOnCloseEnabledback to summary
public boolean isReleaseResourcesOnCloseEnabled()
isScrollableResultSetsEnabledback to summary
public boolean isScrollableResultSetsEnabled()
isSecondLevelCacheEnabledback to summary
public boolean isSecondLevelCacheEnabled()
isSessionFactoryNameAlsoJndiNameback to summary
public boolean isSessionFactoryNameAlsoJndiName()

Is the SesssionFactory name also a JNDI name, indicating we should bind it into JNDI?

Returns:boolean

true if the SessionFactory name is also a JNDI name; false otherwise.

isStatisticsEnabledback to summary
public boolean isStatisticsEnabled()
isStrictJpaQueryLanguageComplianceback to summary
public default boolean isStrictJpaQueryLanguageCompliance()
Annotations
@Deprecated
isStructuredCacheEntriesEnabledback to summary
public boolean isStructuredCacheEntriesEnabled()
isWrapResultSetsEnabledback to summary
public boolean isWrapResultSetsEnabled()

Deprecated

(since 5.5) Scheduled for removal in 6.0 as ResultSet wrapping is no longer needed

Annotations
@Deprecated
jdbcStyleParamsZeroBasedback to summary
public boolean jdbcStyleParamsZeroBased()
nativeExceptionHandling51Complianceback to summary
public default boolean nativeExceptionHandling51Compliance()
setCheckNullabilityback to summary
public void setCheckNullability(boolean enabled)