Class AbstractDelegatingSessionFactoryOptions
- java.lang.Object
-
- org.hibernate.boot.spi.AbstractDelegatingSessionFactoryOptions
-
- All Implemented Interfaces:
SessionFactoryOptions
,QueryEngineOptions
public class AbstractDelegatingSessionFactoryOptions extends Object implements SessionFactoryOptions
Convenience base class for custom implementations ofSessionFactoryOptions
using delegation.- Implementation Note:
- Declared non-abstract to ensure that all
SessionFactoryOptions
methods have at least a default implementation.
-
-
Constructor Summary
Constructors Constructor Description AbstractDelegatingSessionFactoryOptions(SessionFactoryOptions delegate)
-
Method Summary
-
-
-
Constructor Detail
-
AbstractDelegatingSessionFactoryOptions
public AbstractDelegatingSessionFactoryOptions(SessionFactoryOptions delegate)
-
-
Method Detail
-
delegate
protected SessionFactoryOptions delegate()
-
getUuid
public String getUuid()
Description copied from interface:SessionFactoryOptions
Get the UUID unique to this SessionFactoryOptions. Will be the same value available asSessionFactoryImplementor.getUuid()
.- Specified by:
getUuid
in interfaceSessionFactoryOptions
- Returns:
- The UUID for this SessionFactory.
- See Also:
SessionFactoryRegistry.getSessionFactory(java.lang.String)
,SessionFactoryImplementor.getUuid()
-
getServiceRegistry
public StandardServiceRegistry getServiceRegistry()
Description copied from interface:SessionFactoryOptions
The service registry to use in building the factory.- Specified by:
getServiceRegistry
in interfaceSessionFactoryOptions
- Returns:
- The service registry to use.
-
isJpaBootstrap
public boolean isJpaBootstrap()
Description copied from interface:SessionFactoryOptions
Was building of the SessionFactory initiated through JPA bootstrapping, or through Hibernate's native bootstrapping?- Specified by:
isJpaBootstrap
in interfaceSessionFactoryOptions
- Returns:
true
indicates the SessionFactory was built through JPA bootstrapping;false
indicates it was built through native bootstrapping.
-
isJtaTransactionAccessEnabled
public boolean isJtaTransactionAccessEnabled()
- Specified by:
isJtaTransactionAccessEnabled
in interfaceSessionFactoryOptions
-
isAllowRefreshDetachedEntity
public boolean isAllowRefreshDetachedEntity()
- Specified by:
isAllowRefreshDetachedEntity
in interfaceSessionFactoryOptions
-
getBeanManagerReference
public Object getBeanManagerReference()
- Specified by:
getBeanManagerReference
in interfaceSessionFactoryOptions
-
getValidatorFactoryReference
public Object getValidatorFactoryReference()
- Specified by:
getValidatorFactoryReference
in interfaceSessionFactoryOptions
-
getSessionFactoryName
public String getSessionFactoryName()
Description copied from interface:SessionFactoryOptions
The name to be used for the SessionFactory. This is used both in:- in-VM serialization
- JNDI binding, depending on
SessionFactoryOptions.isSessionFactoryNameAlsoJndiName()
- Specified by:
getSessionFactoryName
in interfaceSessionFactoryOptions
- Returns:
- The SessionFactory name
-
isSessionFactoryNameAlsoJndiName
public boolean isSessionFactoryNameAlsoJndiName()
Description copied from interface:SessionFactoryOptions
Is theSesssionFactory name
also a JNDI name, indicating we should bind it into JNDI?- Specified by:
isSessionFactoryNameAlsoJndiName
in interfaceSessionFactoryOptions
- Returns:
true
if the SessionFactory name is also a JNDI name;false
otherwise.
-
isFlushBeforeCompletionEnabled
public boolean isFlushBeforeCompletionEnabled()
- Specified by:
isFlushBeforeCompletionEnabled
in interfaceSessionFactoryOptions
-
isAutoCloseSessionEnabled
public boolean isAutoCloseSessionEnabled()
- Specified by:
isAutoCloseSessionEnabled
in interfaceSessionFactoryOptions
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Specified by:
isStatisticsEnabled
in interfaceSessionFactoryOptions
-
getInterceptor
public Interceptor getInterceptor()
Description copied from interface:SessionFactoryOptions
Get the interceptor to use by default for all sessions opened from this factory.- Specified by:
getInterceptor
in interfaceSessionFactoryOptions
- Returns:
- The interceptor to use factory wide. May be
null
-
getCustomSqmMultiTableMutationStrategy
public SqmMultiTableMutationStrategy getCustomSqmMultiTableMutationStrategy()
Description copied from interface:QueryEngineOptions
Contract for handling SQM trees representing mutation (UPDATE or DELETE) queries where the target of the mutation is a multi-table entity.- Specified by:
getCustomSqmMultiTableMutationStrategy
in interfaceQueryEngineOptions
-
getCustomSqmMultiTableInsertStrategy
public SqmMultiTableInsertStrategy getCustomSqmMultiTableInsertStrategy()
Description copied from interface:QueryEngineOptions
Contract for handling SQM trees representing insertion (INSERT) queries where the target of the mutation is a multi-table entity.- Specified by:
getCustomSqmMultiTableInsertStrategy
in interfaceQueryEngineOptions
-
getStatementInspector
public StatementInspector getStatementInspector()
- Specified by:
getStatementInspector
in interfaceSessionFactoryOptions
-
getSessionFactoryObservers
public SessionFactoryObserver[] getSessionFactoryObservers()
- Specified by:
getSessionFactoryObservers
in interfaceSessionFactoryOptions
-
getBaselineSessionEventsListenerBuilder
public BaselineSessionEventsListenerBuilder getBaselineSessionEventsListenerBuilder()
- Specified by:
getBaselineSessionEventsListenerBuilder
in interfaceSessionFactoryOptions
-
isIdentifierRollbackEnabled
public boolean isIdentifierRollbackEnabled()
- Specified by:
isIdentifierRollbackEnabled
in interfaceSessionFactoryOptions
-
isCheckNullability
public boolean isCheckNullability()
- Specified by:
isCheckNullability
in interfaceSessionFactoryOptions
-
isInitializeLazyStateOutsideTransactionsEnabled
public boolean isInitializeLazyStateOutsideTransactionsEnabled()
- Specified by:
isInitializeLazyStateOutsideTransactionsEnabled
in interfaceSessionFactoryOptions
-
getTempTableDdlTransactionHandling
public TempTableDdlTransactionHandling getTempTableDdlTransactionHandling()
- Specified by:
getTempTableDdlTransactionHandling
in interfaceSessionFactoryOptions
-
getBatchFetchStyle
public BatchFetchStyle getBatchFetchStyle()
- Specified by:
getBatchFetchStyle
in interfaceSessionFactoryOptions
-
isDelayBatchFetchLoaderCreationsEnabled
public boolean isDelayBatchFetchLoaderCreationsEnabled()
- Specified by:
isDelayBatchFetchLoaderCreationsEnabled
in interfaceSessionFactoryOptions
-
getDefaultBatchFetchSize
public int getDefaultBatchFetchSize()
- Specified by:
getDefaultBatchFetchSize
in interfaceSessionFactoryOptions
-
getMaximumFetchDepth
public Integer getMaximumFetchDepth()
- Specified by:
getMaximumFetchDepth
in interfaceSessionFactoryOptions
-
isSubselectFetchEnabled
public boolean isSubselectFetchEnabled()
- Specified by:
isSubselectFetchEnabled
in interfaceSessionFactoryOptions
-
getDefaultNullPrecedence
public NullPrecedence getDefaultNullPrecedence()
- Specified by:
getDefaultNullPrecedence
in interfaceSessionFactoryOptions
-
isOrderUpdatesEnabled
public boolean isOrderUpdatesEnabled()
- Specified by:
isOrderUpdatesEnabled
in interfaceSessionFactoryOptions
-
isOrderInsertsEnabled
public boolean isOrderInsertsEnabled()
- Specified by:
isOrderInsertsEnabled
in interfaceSessionFactoryOptions
-
isMultiTenancyEnabled
public boolean isMultiTenancyEnabled()
- Specified by:
isMultiTenancyEnabled
in interfaceSessionFactoryOptions
-
getCurrentTenantIdentifierResolver
public CurrentTenantIdentifierResolver<Object> getCurrentTenantIdentifierResolver()
- Specified by:
getCurrentTenantIdentifierResolver
in interfaceSessionFactoryOptions
-
getDefaultTenantIdentifierJavaType
public JavaType<Object> getDefaultTenantIdentifierJavaType()
Description copied from interface:SessionFactoryOptions
The default tenant identifier java type to use, in case no explicit tenant identifier property is defined.- Specified by:
getDefaultTenantIdentifierJavaType
in interfaceSessionFactoryOptions
-
isJtaTrackByThread
public boolean isJtaTrackByThread()
- Specified by:
isJtaTrackByThread
in interfaceSessionFactoryOptions
-
isNamedQueryStartupCheckingEnabled
public boolean isNamedQueryStartupCheckingEnabled()
- Specified by:
isNamedQueryStartupCheckingEnabled
in interfaceSessionFactoryOptions
-
isAllowOutOfTransactionUpdateOperations
public boolean isAllowOutOfTransactionUpdateOperations()
- Specified by:
isAllowOutOfTransactionUpdateOperations
in interfaceSessionFactoryOptions
-
isReleaseResourcesOnCloseEnabled
public boolean isReleaseResourcesOnCloseEnabled()
- Specified by:
isReleaseResourcesOnCloseEnabled
in interfaceSessionFactoryOptions
-
isSecondLevelCacheEnabled
public boolean isSecondLevelCacheEnabled()
- Specified by:
isSecondLevelCacheEnabled
in interfaceSessionFactoryOptions
-
isQueryCacheEnabled
public boolean isQueryCacheEnabled()
- Specified by:
isQueryCacheEnabled
in interfaceSessionFactoryOptions
-
getQueryCacheLayout
public CacheLayout getQueryCacheLayout()
- Specified by:
getQueryCacheLayout
in interfaceSessionFactoryOptions
-
getTimestampsCacheFactory
public TimestampsCacheFactory getTimestampsCacheFactory()
- Specified by:
getTimestampsCacheFactory
in interfaceSessionFactoryOptions
-
getCacheRegionPrefix
public String getCacheRegionPrefix()
- Specified by:
getCacheRegionPrefix
in interfaceSessionFactoryOptions
-
isMinimalPutsEnabled
public boolean isMinimalPutsEnabled()
- Specified by:
isMinimalPutsEnabled
in interfaceSessionFactoryOptions
-
isStructuredCacheEntriesEnabled
public boolean isStructuredCacheEntriesEnabled()
- Specified by:
isStructuredCacheEntriesEnabled
in interfaceSessionFactoryOptions
-
isDirectReferenceCacheEntriesEnabled
public boolean isDirectReferenceCacheEntriesEnabled()
- Specified by:
isDirectReferenceCacheEntriesEnabled
in interfaceSessionFactoryOptions
-
isAutoEvictCollectionCache
public boolean isAutoEvictCollectionCache()
- Specified by:
isAutoEvictCollectionCache
in interfaceSessionFactoryOptions
-
getSchemaAutoTooling
public SchemaAutoTooling getSchemaAutoTooling()
- Specified by:
getSchemaAutoTooling
in interfaceSessionFactoryOptions
-
getJdbcBatchSize
public int getJdbcBatchSize()
- Specified by:
getJdbcBatchSize
in interfaceSessionFactoryOptions
-
isJdbcBatchVersionedData
public boolean isJdbcBatchVersionedData()
- Specified by:
isJdbcBatchVersionedData
in interfaceSessionFactoryOptions
-
isScrollableResultSetsEnabled
public boolean isScrollableResultSetsEnabled()
- Specified by:
isScrollableResultSetsEnabled
in interfaceSessionFactoryOptions
-
isGetGeneratedKeysEnabled
public boolean isGetGeneratedKeysEnabled()
- Specified by:
isGetGeneratedKeysEnabled
in interfaceSessionFactoryOptions
-
getJdbcFetchSize
public Integer getJdbcFetchSize()
- Specified by:
getJdbcFetchSize
in interfaceSessionFactoryOptions
-
getPhysicalConnectionHandlingMode
public PhysicalConnectionHandlingMode getPhysicalConnectionHandlingMode()
- Specified by:
getPhysicalConnectionHandlingMode
in interfaceSessionFactoryOptions
-
doesConnectionProviderDisableAutoCommit
public boolean doesConnectionProviderDisableAutoCommit()
- Specified by:
doesConnectionProviderDisableAutoCommit
in interfaceSessionFactoryOptions
-
isCommentsEnabled
public boolean isCommentsEnabled()
- Specified by:
isCommentsEnabled
in interfaceSessionFactoryOptions
-
getCustomEntityDirtinessStrategy
public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy()
- Specified by:
getCustomEntityDirtinessStrategy
in interfaceSessionFactoryOptions
-
getEntityNameResolvers
public EntityNameResolver[] getEntityNameResolvers()
- Specified by:
getEntityNameResolvers
in interfaceSessionFactoryOptions
-
getEntityNotFoundDelegate
public EntityNotFoundDelegate getEntityNotFoundDelegate()
Description copied from interface:SessionFactoryOptions
Get the delegate for handling entity-not-found exception conditions.- Specified by:
getEntityNotFoundDelegate
in interfaceSessionFactoryOptions
- Returns:
- The specific EntityNotFoundDelegate to use, May be
null
-
getCustomSqlFunctionMap
public Map<String,SqmFunctionDescriptor> getCustomSqlFunctionMap()
Description copied from interface:QueryEngineOptions
User defined SQM functions available for use in HQL and Criteria.Ultimately made available to the
SqmTranslatorFactory
for use in translating an SQM tree.Can be used in conjunction with
QueryEngineOptions.getCustomSqmFunctionRegistry()
, but generally one or the other will be used.- Specified by:
getCustomSqlFunctionMap
in interfaceQueryEngineOptions
-
setCheckNullability
public void setCheckNullability(boolean enabled)
- Specified by:
setCheckNullability
in interfaceSessionFactoryOptions
-
isPreferUserTransaction
public boolean isPreferUserTransaction()
- Specified by:
isPreferUserTransaction
in interfaceSessionFactoryOptions
-
getStatelessInterceptorImplementorSupplier
public Supplier<? extends Interceptor> getStatelessInterceptorImplementorSupplier()
Description copied from interface:SessionFactoryOptions
Get the interceptor to use by default for all sessions opened from this factory.- Specified by:
getStatelessInterceptorImplementorSupplier
in interfaceSessionFactoryOptions
- Returns:
- The interceptor to use factory wide. May be
null
-
getCustomHqlTranslator
public HqlTranslator getCustomHqlTranslator()
Description copied from interface:QueryEngineOptions
Translator for transforming HQL (as an Antlr parse tree) into an SQM tree.- Specified by:
getCustomHqlTranslator
in interfaceQueryEngineOptions
- See Also:
org.hibernate.query.hql
-
getCustomSqmTranslatorFactory
public SqmTranslatorFactory getCustomSqmTranslatorFactory()
Description copied from interface:QueryEngineOptions
Factory for translators transforming an SQM tree into a different form. For standard ORM implementations this will generally be some form of SQL tree.- Specified by:
getCustomSqmTranslatorFactory
in interfaceQueryEngineOptions
- See Also:
org.hibernate.sql.ast.tree
-
getJdbcTimeZone
public TimeZone getJdbcTimeZone()
- Specified by:
getJdbcTimeZone
in interfaceSessionFactoryOptions
-
getCriteriaValueHandlingMode
public ValueHandlingMode getCriteriaValueHandlingMode()
- Specified by:
getCriteriaValueHandlingMode
in interfaceQueryEngineOptions
- Specified by:
getCriteriaValueHandlingMode
in interfaceSessionFactoryOptions
- See Also:
QuerySettings.CRITERIA_VALUE_HANDLING_MODE
-
isCriteriaCopyTreeEnabled
public boolean isCriteriaCopyTreeEnabled()
- Specified by:
isCriteriaCopyTreeEnabled
in interfaceSessionFactoryOptions
- See Also:
QuerySettings.CRITERIA_COPY_TREE
-
getNativeJdbcParametersIgnored
public boolean getNativeJdbcParametersIgnored()
- Specified by:
getNativeJdbcParametersIgnored
in interfaceSessionFactoryOptions
- See Also:
QuerySettings.NATIVE_IGNORE_JDBC_PARAMETERS
-
getJpaCompliance
public JpaCompliance getJpaCompliance()
- Specified by:
getJpaCompliance
in interfaceQueryEngineOptions
- Specified by:
getJpaCompliance
in interfaceSessionFactoryOptions
-
isFailOnPaginationOverCollectionFetchEnabled
public boolean isFailOnPaginationOverCollectionFetchEnabled()
- Specified by:
isFailOnPaginationOverCollectionFetchEnabled
in interfaceSessionFactoryOptions
-
getImmutableEntityUpdateQueryHandlingMode
public ImmutableEntityUpdateQueryHandlingMode getImmutableEntityUpdateQueryHandlingMode()
- Specified by:
getImmutableEntityUpdateQueryHandlingMode
in interfaceSessionFactoryOptions
-
getDefaultCatalog
public String getDefaultCatalog()
Description copied from interface:SessionFactoryOptions
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).- Specified by:
getDefaultCatalog
in interfaceSessionFactoryOptions
- Returns:
- The default catalog to use.
-
getDefaultSchema
public String getDefaultSchema()
Description copied from interface:SessionFactoryOptions
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).- Specified by:
getDefaultSchema
in interfaceSessionFactoryOptions
- Returns:
- The default schema to use.
-
inClauseParameterPaddingEnabled
public boolean inClauseParameterPaddingEnabled()
- Specified by:
inClauseParameterPaddingEnabled
in interfaceSessionFactoryOptions
- See Also:
QuerySettings.IN_CLAUSE_PARAMETER_PADDING
-
isPortableIntegerDivisionEnabled
public boolean isPortableIntegerDivisionEnabled()
- Specified by:
isPortableIntegerDivisionEnabled
in interfaceQueryEngineOptions
- Specified by:
isPortableIntegerDivisionEnabled
in interfaceSessionFactoryOptions
- See Also:
QuerySettings.PORTABLE_INTEGER_DIVISION
-
getQueryStatisticsMaxSize
public int getQueryStatisticsMaxSize()
- Specified by:
getQueryStatisticsMaxSize
in interfaceSessionFactoryOptions
-
areJPACallbacksEnabled
public boolean areJPACallbacksEnabled()
- Specified by:
areJPACallbacksEnabled
in interfaceSessionFactoryOptions
-
isCollectionsInDefaultFetchGroupEnabled
public boolean isCollectionsInDefaultFetchGroupEnabled()
- Specified by:
isCollectionsInDefaultFetchGroupEnabled
in interfaceSessionFactoryOptions
-
isUnownedAssociationTransientCheck
public boolean isUnownedAssociationTransientCheck()
- Specified by:
isUnownedAssociationTransientCheck
in interfaceSessionFactoryOptions
-
isUseOfJdbcNamedParametersEnabled
public boolean isUseOfJdbcNamedParametersEnabled()
Description copied from interface:SessionFactoryOptions
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.- Specified by:
isUseOfJdbcNamedParametersEnabled
in interfaceSessionFactoryOptions
- 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:
QuerySettings.CALLABLE_NAMED_PARAMS_ENABLED
-
getCustomSqmFunctionRegistry
public SqmFunctionRegistry getCustomSqmFunctionRegistry()
Description copied from interface:QueryEngineOptions
User supplied registry of SQM functions available for use in HQL and CriteriaCan be used in conjunction with
QueryEngineOptions.getCustomSqlFunctionMap()
, but generally one or the other will be used.- Specified by:
getCustomSqmFunctionRegistry
in interfaceQueryEngineOptions
-
getPreferredSqlTypeCodeForBoolean
public int getPreferredSqlTypeCodeForBoolean()
- Specified by:
getPreferredSqlTypeCodeForBoolean
in interfaceSessionFactoryOptions
-
getPreferredSqlTypeCodeForDuration
public int getPreferredSqlTypeCodeForDuration()
- Specified by:
getPreferredSqlTypeCodeForDuration
in interfaceSessionFactoryOptions
-
getPreferredSqlTypeCodeForUuid
public int getPreferredSqlTypeCodeForUuid()
- Specified by:
getPreferredSqlTypeCodeForUuid
in interfaceSessionFactoryOptions
-
getPreferredSqlTypeCodeForInstant
public int getPreferredSqlTypeCodeForInstant()
- Specified by:
getPreferredSqlTypeCodeForInstant
in interfaceSessionFactoryOptions
-
getPreferredSqlTypeCodeForArray
public int getPreferredSqlTypeCodeForArray()
- Specified by:
getPreferredSqlTypeCodeForArray
in interfaceSessionFactoryOptions
-
getDefaultTimeZoneStorageStrategy
public TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
- Specified by:
getDefaultTimeZoneStorageStrategy
in interfaceSessionFactoryOptions
-
isPreferJavaTimeJdbcTypesEnabled
public boolean isPreferJavaTimeJdbcTypesEnabled()
- Specified by:
isPreferJavaTimeJdbcTypesEnabled
in interfaceSessionFactoryOptions
-
isPreferNativeEnumTypesEnabled
public boolean isPreferNativeEnumTypesEnabled()
- Specified by:
isPreferNativeEnumTypesEnabled
in interfaceSessionFactoryOptions
-
getJsonFormatMapper
public FormatMapper getJsonFormatMapper()
Description copied from interface:SessionFactoryOptions
The format mapper to use for serializing/deserializing JSON data.- Specified by:
getJsonFormatMapper
in interfaceSessionFactoryOptions
-
getXmlFormatMapper
public FormatMapper getXmlFormatMapper()
Description copied from interface:SessionFactoryOptions
The format mapper to use for serializing/deserializing XML data.- Specified by:
getXmlFormatMapper
in interfaceSessionFactoryOptions
-
isPassProcedureParameterNames
public boolean isPassProcedureParameterNames()
- Specified by:
isPassProcedureParameterNames
in interfaceSessionFactoryOptions
-
-