Class AbstractSharedSessionContract
- All Implemented Interfaces:
Serializable,AutoCloseable,LobCreationContext,SharedSessionContractImplementor,QueryProducer,QueryProducerImplementor,JdbcSessionOwner,TransactionCoordinatorBuilder.Options,SharedSessionContract,JavaType.CoercionContext,WrapperOptions
- Direct Known Subclasses:
SessionImpl,StatelessSessionImpl
SharedSessionContract and
SharedSessionContractImplementor. Intended for concrete implementations of
Session and StatelessSession.
- See Also:
- Implementation Note:
- A
Sessionor JPAEntityManageris a single-threaded object, which may not be called concurrently. Therefore, this implementation defines access to a number of instance state values in a manner that is not exactly thread-safe.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext
LobCreationContext.Callback<T> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSharedSessionContract(SessionFactoryImpl factory, SessionCreationOptions options) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the currentTransaction, or creates a new transaction if there is no transaction active.protected voidaddSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator) voidafterObtainConnection(Connection connection) Called after a managed JDBC connection is obtained.voidafterTransactionCompletion(boolean successful, boolean delayed) An after-completion callback to the owner.protected voidapplyQuerySettingsAndHints(Query<?> query) protected voidapplyQuerySettingsAndHints(SelectionQuery<?> query) voidbeforeReleaseConnection(Connection connection) Called right before a managed JDBC connection is released.voidA before-completion callback to the owner.Begin a unit of work and return the associatedTransactionobject.protected <T,Q extends CommonQueryContract>
QbuildNamedQuery(String queryName, Function<NamedSqmQueryMemento<T>, Q> sqmCreator, Function<NamedNativeQueryMemento<T>, Q> nativeCreator) protected static voidcheckMutationQuery(String hqlString, SqmStatement<?> sqmStatement) voidcheckOpen(boolean markForRollbackIfClosed) Check whether the session is open, and if not: ifmarkForRollbackIfClosed = true, mark the current transaction, if any, for rollback only, and throw anIllegalStateException.protected static <R> voidcheckResultType(Class<R> expectedResultType, SqmSelectionQueryImpl<R> query) protected static voidcheckSelectionQuery(String hql, HqlInterpretation<?> hqlInterpretation) voidcheckTransactionNeededForUpdateOperation(String exceptionMessage) Check if an activeTransactionis available before performing an update operation against the database.protected voidprotected voidvoidclose()End the session by releasing the JDBC connection and cleaning up.protected <T> QueryImplementor<T> createCriteriaQuery(SqmStatement<T> criteria, Class<T> resultType) <T> RootGraphImplementor<T> createEntityGraph(Class<T> rootType) Create a new mutable instance ofEntityGraph, with only a root node, allowing programmatic definition of the graph from scratch.<T> RootGraph<T> createEntityGraph(Class<T> rootType, String graphName) Create a new mutable instance ofEntityGraph, based on a predefined named entity graph, allowing customization of the graph, or returnnullif there is no predefined graph with the given name.createEntityGraph(String graphName) Create a new mutable instance ofEntityGraph, based on a predefined named entity graph, allowing customization of the graph, or returnnullif there is no predefined graph with the given name.createMutationQuery(CriteriaDelete deleteQuery) Create aMutationQueryfrom the given delete criteria treecreateMutationQuery(CriteriaUpdate updateQuery) Create aMutationQueryfrom the given update criteria treecreateMutationQuery(String hqlString) Create aMutationQueryreference for the given HQL insert, update, or delete statement.createMutationQuery(JpaCriteriaInsert insert) Create aMutationQueryfrom the given insert criteria treecreateNamedMutationQuery(String queryName) Create aMutationQueryinstance for the given named insert, update, or delete HQL query.createNamedQuery(String name) Create a typedQueryinstance for the given named query.<R> QueryImplementor<R> createNamedQuery(String name, Class<R> resultClass) Create a typedQueryinstance for the given named query.createNamedSelectionQuery(String queryName) Create aSelectionQueryinstance for the namedNamedQuery.<R> SelectionQuery<R> createNamedSelectionQuery(String queryName, Class<R> expectedResultType) Create aSelectionQueryinstance for the namedNamedQuerywith the given result type.Obtain aProcedureCallbased on a named templatecreateNativeMutationQuery(String sqlString) Create aNativeQueryinstance for the given native SQL statement.createNativeQuery(String sqlString) Create aNativeQueryinstance for the given native SQL query.createNativeQuery(String sqlString, @Nullable Class resultClass) Create aNativeQueryinstance for the given native SQL query using an implicit mapping to the specified Java type.<T> NativeQueryImplementor<T> createNativeQuery(String sqlString, Class<T> resultClass, String tableAlias) Create aNativeQueryinstance for the given native SQL query using an implicit mapping to the specified Java entity type.createNativeQuery(String sqlString, String resultSetMappingName) Create aNativeQueryinstance for the given native SQL query using an explicit mapping to the specified Java type.<T> NativeQueryImplementor<T> createNativeQuery(String sqlString, String resultSetMappingName, Class<T> resultClass) Create aNativeQueryinstance for the given native SQL query using an explicit mapping to the specified Java type.protected <T> NativeQueryImplementor<T> createNativeQueryImplementor(Class<T> resultType, NamedNativeQueryMemento<?> memento) protected <T> NativeQueryImplementor<T> createNativeQueryImplementor(String queryName, NamedNativeQueryMemento<T> memento) protected <T> NativeQueryImplementor<T> createNativeQueryImplementor(NamedNativeQueryMemento<T> memento) createQuery(CriteriaDelete criteriaDelete) Create aMutationQueryfor the given JPACriteriaDelete<T> QueryImplementor<T> createQuery(CriteriaQuery<T> criteriaQuery) Create aQueryfor the given JPACriteriaQuery.createQuery(CriteriaUpdate criteriaUpdate) Create aMutationQueryfor the given JPACriteriaUpdate<R> QueryImplementor<R> createQuery(TypedQueryReference<R> typedQueryReference) Create a typedQueryinstance for the given typed query reference.createQuery(String queryString) Create aQueryinstance for the given HQL query, or HQL insert, update, or delete statement.<T> QueryImplementor<T> createQuery(String queryString, Class<T> expectedResultType) Create a typedQueryinstance for the given HQL query string and given query result type.<R> SelectionQuery<R> createSelectionQuery(CriteriaQuery<R> criteria) Create aSelectionQueryreference for the givenCriteriaQuery.createSelectionQuery(String hqlString) Create aSelectionQueryreference for the given HQLselectstatement.<R> SelectionQuery<R> createSelectionQuery(String hqlString, EntityGraph<R> resultGraph) Create aSelectionQueryinstance for the given HQL query string and givenEntityGraph, which is interpreted as a load graph.<R> SelectionQuery<R> createSelectionQuery(String hqlString, Class<R> expectedResultType) Create aSelectionQueryinstance for the given HQL query string and given query result type.protected <T> SqmQueryImplementor<T> createSqmQueryImplementor(Class<T> resultType, NamedSqmQueryMemento<?> memento) protected <T> SqmQueryImplementor<T> createSqmQueryImplementor(String queryName, NamedSqmQueryMemento<T> memento) protected <T> SqmQueryImplementor<T> createSqmQueryImplementor(NamedSqmQueryMemento<T> memento) createStoredProcedureCall(String procedureName) Create aProcedureCallto a stored procedure.createStoredProcedureCall(String procedureName, Class<?>... resultClasses) Create aProcedureCallto a stored procedure with the given result set entity mappings.createStoredProcedureCall(String procedureName, String... resultSetMappings) Create aProcedureCallto a stored procedure with the given result set entity mappings.createStoredProcedureQuery(String procedureName) Create aProcedureCallto a stored procedure.createStoredProcedureQuery(String procedureName, Class<?>... resultClasses) Create aProcedureCallto a stored procedure with the given result set entity mappings.createStoredProcedureQuery(String procedureName, String... resultSetMappings) Create aProcedureCallto a stored procedure with the given result set entity mappings.protected voidvoiddisableFilter(String filterName) Disable the named filter for the current session.<T> TdoReturningWork(ReturningWork<T> work) Perform work using theConnectionunderlying by this session, and return a result.voidPerform work using theConnectionunderlying by this session.enableFilter(String filterName) Enable the named filter for this current session.<T> Texecute(LobCreationContext.Callback<T> callback) Execute the given callback, making sure it has access to a viable JDBCConnection.generateEntityKey(Object id, EntityPersister persister) Instantiate anEntityKeywith the given id and for the entity represented by the givenEntityPersister.Get the current cache mode for this session.The currentCacheTransactionSynchronizationassociated with this session.Override the implementation provided on SharedSessionContractImplementor which is not very efficient: this method is hot in Hibernate Reactive, and could be hot in some ORM contexts as well.protected TransactionObtain theDialect.getEnabledFilter(String filterName) Retrieve a currently enabled filter by name.getEntityGraph(String graphName) Obtain an immutable reference to a predefined named entity graph.<T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass) Retrieve all namedEntityGraphs with the given root entity type.final EntityNameResolverGet theSessionEventListenerManagerassociated with this session.Obtain a reference to theEventMonitor.Obtain anExceptionConverterfor reporting an error.Obtain the factory which created this session.final InterceptorRetrieves theInterceptorassociated with this session.Get the session-level JDBC batch size for the current session.final JdbcCoordinatorObtain theJdbcCoordinatorfor this session.final JdbcServicesObtain theJdbcServicesfor the factory which created this session.final JdbcSessionContextThe JDBCTimeZoneused when writing a value of typeTimeorTimestampto a JDBCPreparedStatement, or when reading from a JDBCResultSet.Obtain the JSONFormatMapper.Obtain access to theLobCreator.getNamedNativeQuery(String queryName) Get aNativeQueryinstance for a named native SQL querygetNamedNativeQuery(String queryName, String resultSetMapping) Get aNativeQueryinstance for a named native SQL querygetNamedProcedureCall(String name) Obtain aProcedureCallbased on a named templategetNamedQuery(String queryName) Deprecated.booleanintThe JDBCtype codeused to bind a null boolean value.protected NamedResultSetMappingMementogetResultSetMappingMemento(String resultSetMappingName) Wrap all state that lazy loading interceptors might need to manage association with this session, or to handle lazy loading after detachment via the UUID of the SessionFactory.Obtain the factory which created this session.final UUIDObtain aUUIDwhich uniquely identifies this session.final ObjectObtain a "token" which uniquely identifies this session.Obtain the tenant identifier associated with this session, as a string.final ObjectObtain the tenant identifier associated with this session.Get theTransactioninstance associated with this session.final TransactionCoordinatorObtain theTransactionCoordinator.Obtain theTypeConfigurationfor the factory which created this session.Obtain the XMLFormatMapper.protected <R> HqlInterpretation<R> interpretHql(String hql, Class<R> resultType) booleanisClosed()Determines whether the session is closed.booleanCheck if the session is currently connected.booleanbooleanbooleanCheck if the session is joined to the current transaction.booleanisOpen()Check if the session is still open.booleanDetermines whether the session is open or is waiting for auto-close.booleanDoes this session have an active Hibernate transaction, or is it associated with a JTA transaction currently in progress?voidJoin the currently-active JTA transaction.voidMarks current transaction, if any, for rollback only.protected voidvoidprepareForQueryExecution(boolean requiresTxn) Prepare for the execution of aQueryorProcedureCallprotected voidprotected voidremoveSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator) protected final CollectionPersisterrequireCollectionPersister(String roleName) protected final EntityPersisterrequireEntityPersister(Class<?> entityClass) protected final EntityPersisterrequireEntityPersister(String entityName) voidsetCacheMode(CacheMode cacheMode) Set the current cache mode for this session.protected voidvoidsetCriteriaCopyTreeEnabled(boolean jpaCriteriaCopyComplianceEnabled) voidsetCriteriaPlanCacheEnabled(boolean criteriaPlanCacheEnabled) voidsetJdbcBatchSize(Integer jdbcBatchSize) Set the session-level JDBC batch size.voidsetNativeJdbcParametersIgnored(boolean nativeJdbcParametersIgnored) protected final voidsetUpMultitenancy(SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) booleanIndicates whether an active transaction should be automatically joined.protected booleanshouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared) voidCallback indicating recognition of entering into a transactional context whether that is explicitly via the HibernateTransactionAPI or via registration of Hibernate's JTA Synchronization impl with a JTA TransactionbooleanDetermines whether streams should be used for binding LOB values.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.resource.jdbc.spi.JdbcSessionOwner
afterTransactionBegin, flushBeforeTransactionCompletion, getEventManager, getSqlExceptionHelperMethods inherited from interface org.hibernate.engine.jdbc.LobCreationContext
fromContextMethods inherited from interface org.hibernate.SharedSessionContract
fromTransaction, inTransaction, unwrapMethods inherited from interface org.hibernate.engine.spi.SharedSessionContractImplementor
afterOperation, afterScrollOperation, asEventSource, asSessionImplementor, asStatelessSession, autoFlushIfRequired, autoFlushIfRequired, autoPreFlush, bestGuessEntityName, bestGuessEntityName, checkOpen, flush, getContextEntityIdentifier, getEntityPersister, getEntityUsingInterceptor, getHibernateFlushMode, getLoadQueryInfluencers, getPersistenceContext, getPersistenceContextInternal, getSession, guessEntityName, immediateLoad, initializeCollection, instantiate, instantiate, internalLoad, isDefaultReadOnly, isEventSource, isIdentifierRollbackEnabled, isSessionImplementor, isStatelessSession, loadFromSecondLevelCache, lock, registerProcess
-
Field Details
-
closed
protected boolean closed -
waitingForAutoClose
protected boolean waitingForAutoClose
-
-
Constructor Details
-
AbstractSharedSessionContract
-
-
Method Details
-
setUpMultitenancy
protected final void setUpMultitenancy(SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) -
getConfiguredJdbcBatchSize
Override the implementation provided on SharedSessionContractImplementor which is not very efficient: this method is hot in Hibernate Reactive, and could be hot in some ORM contexts as well.- Specified by:
getConfiguredJdbcBatchSizein interfaceSharedSessionContractImplementor- Returns:
- the session-level JDBC batch size is set, or the factory-level setting otherwise
- See Also:
-
prepareForAutoClose
protected void prepareForAutoClose() -
shouldAutoJoinTransaction
public boolean shouldAutoJoinTransaction()Description copied from interface:TransactionCoordinatorBuilder.OptionsIndicates whether an active transaction should be automatically joined. Only relevant for JTA-based TransactionCoordinator instances.- Specified by:
shouldAutoJoinTransactionin interfaceTransactionCoordinatorBuilder.Options- Returns:
trueindicates the active transaction should be auto joined;falseindicates it should not (untilTransactionCoordinator.explicitJoin()is called).
-
getFactory
Description copied from interface:SharedSessionContractImplementorObtain the factory which created this session.- Specified by:
getFactoryin interfaceQueryProducerImplementor- Specified by:
getFactoryin interfaceSharedSessionContract- Specified by:
getFactoryin interfaceSharedSessionContractImplementor
-
getInterceptor
Description copied from interface:SharedSessionContractImplementorRetrieves theInterceptorassociated with this session.- Specified by:
getInterceptorin interfaceSharedSessionContractImplementor
-
getJdbcCoordinator
Description copied from interface:SharedSessionContractImplementorObtain theJdbcCoordinatorfor this session.- Specified by:
getJdbcCoordinatorin interfaceSharedSessionContractImplementor
-
getTransactionCoordinator
Description copied from interface:JdbcSessionOwnerObtain theTransactionCoordinator.- Specified by:
getTransactionCoordinatorin interfaceJdbcSessionOwner- Returns:
- The
TransactionCoordinator
-
getJdbcSessionContext
- Specified by:
getJdbcSessionContextin interfaceJdbcSessionOwner
-
getEntityNameResolver
-
getEventListenerManager
Description copied from interface:SharedSessionContractImplementorGet theSessionEventListenerManagerassociated with this session.- Specified by:
getEventListenerManagerin interfaceSharedSessionContractImplementor
-
getSessionIdentifier
Description copied from interface:SharedSessionContractImplementorObtain aUUIDwhich uniquely identifies this session.The UUID is useful mainly for logging.
- Specified by:
getSessionIdentifierin interfaceSharedSessionContractImplementor
-
getSessionToken
Description copied from interface:SharedSessionContractImplementorObtain a "token" which uniquely identifies this session.- Specified by:
getSessionTokenin interfaceSharedSessionContractImplementor
-
getTenantIdentifier
Description copied from interface:SharedSessionContractObtain the tenant identifier associated with this session, as a string.- Specified by:
getTenantIdentifierin interfaceSharedSessionContract- Returns:
- The tenant identifier associated with this session, or
null - See Also:
-
getTenantIdentifierValue
Description copied from interface:SharedSessionContractObtain the tenant identifier associated with this session.- Specified by:
getTenantIdentifierValuein interfaceSharedSessionContract- Returns:
- The tenant identifier associated with this session, or
null - See Also:
-
isOpen
public boolean isOpen()Description copied from interface:SharedSessionContractCheck if the session is still open.- Specified by:
isOpenin interfaceSharedSessionContract- Returns:
trueif it is open
-
isClosed
public boolean isClosed()Description copied from interface:SharedSessionContractImplementorDetermines whether the session is closed.- Specified by:
isClosedin interfaceSharedSessionContractImplementor- Returns:
trueif the session is closed;falseotherwise.
-
close
public void close()Description copied from interface:SharedSessionContractEnd the session by releasing the JDBC connection and cleaning up.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSharedSessionContract
-
setClosed
protected void setClosed() -
shouldCloseJdbcCoordinatorOnClose
protected boolean shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared) -
cleanupOnClose
protected void cleanupOnClose() -
isOpenOrWaitingForAutoClose
public boolean isOpenOrWaitingForAutoClose()Description copied from interface:SharedSessionContractImplementorDetermines whether the session is open or is waiting for auto-close.- Specified by:
isOpenOrWaitingForAutoClosein interfaceSharedSessionContractImplementor- Returns:
trueif the session is closed, or if it's waiting for auto-close;falseotherwise.
-
checkOpen
public void checkOpen(boolean markForRollbackIfClosed) Description copied from interface:SharedSessionContractImplementorCheck whether the session is open, and if not:- if
markForRollbackIfClosed = true, mark the current transaction, if any, for rollback only, and - throw an
IllegalStateException. (JPA specifies this exception type.)
- Specified by:
checkOpenin interfaceSharedSessionContractImplementor
- if
-
prepareForQueryExecution
public void prepareForQueryExecution(boolean requiresTxn) Description copied from interface:SharedSessionContractImplementorPrepare for the execution of aQueryorProcedureCall- Specified by:
prepareForQueryExecutionin interfaceSharedSessionContractImplementor
-
markForRollbackOnly
public void markForRollbackOnly()Description copied from interface:SharedSessionContractImplementorMarks current transaction, if any, for rollback only.- Specified by:
markForRollbackOnlyin interfaceSharedSessionContractImplementor
-
isTransactionInProgress
public boolean isTransactionInProgress()Description copied from interface:SharedSessionContractImplementorDoes this session have an active Hibernate transaction, or is it associated with a JTA transaction currently in progress?- Specified by:
isTransactionInProgressin interfaceSharedSessionContractImplementor
-
checkTransactionNeededForUpdateOperation
Description copied from interface:SharedSessionContractImplementorCheck if an activeTransactionis available before performing an update operation against the database.If an active transaction is necessary, but no transaction is active, a
TransactionRequiredExceptionis raised.- Specified by:
checkTransactionNeededForUpdateOperationin interfaceSharedSessionContractImplementor- Parameters:
exceptionMessage- the message to use for theTransactionRequiredException
-
getTransaction
Description copied from interface:SharedSessionContractGet theTransactioninstance associated with this session.- Specified by:
getTransactionin interfaceSharedSessionContract- Returns:
- an instance of
Transactionrepresenting the transaction associated with this session - Throws:
HibernateException- See Also:
-
accessTransaction
Description copied from interface:SharedSessionContractImplementorRetrieves the currentTransaction, or creates a new transaction if there is no transaction active.This method is primarily for internal or integrator use.
- Specified by:
accessTransactionin interfaceSharedSessionContractImplementor- Returns:
- the
Transaction
-
startTransactionBoundary
public void startTransactionBoundary()Description copied from interface:JdbcSessionOwnerCallback indicating recognition of entering into a transactional context whether that is explicitly via the HibernateTransactionAPI or via registration of Hibernate's JTA Synchronization impl with a JTA Transaction- Specified by:
startTransactionBoundaryin interfaceJdbcSessionOwner
-
beforeTransactionCompletion
public void beforeTransactionCompletion()Description copied from interface:JdbcSessionOwnerA before-completion callback to the owner.- Specified by:
beforeTransactionCompletionin interfaceJdbcSessionOwner
-
afterTransactionCompletion
public void afterTransactionCompletion(boolean successful, boolean delayed) Description copied from interface:JdbcSessionOwnerAn after-completion callback to the owner.- Specified by:
afterTransactionCompletionin interfaceJdbcSessionOwner- Parameters:
successful- Was the transaction successful?delayed- Is this a delayed after transaction completion call (aka after a timeout)?
-
getCacheTransactionSynchronization
Description copied from interface:SharedSessionContractImplementorThe currentCacheTransactionSynchronizationassociated with this session. This may benullif the session is not currently associated with an active transaction.- Specified by:
getCacheTransactionSynchronizationin interfaceSharedSessionContractImplementor
-
beginTransaction
Description copied from interface:SharedSessionContractBegin a unit of work and return the associatedTransactionobject. If a new underlying transaction is required, begin the transaction. Otherwise, continue the new work in the context of the existing underlying transaction.- Specified by:
beginTransactionin interfaceSharedSessionContract- Returns:
- an instance of
Transactionrepresenting the new transaction - See Also:
-
checkTransactionSynchStatus
protected void checkTransactionSynchStatus() -
pulseTransactionCoordinator
protected void pulseTransactionCoordinator() -
joinTransaction
public void joinTransaction()Description copied from interface:SharedSessionContractJoin the currently-active JTA transaction.- Specified by:
joinTransactionin interfaceSharedSessionContract- See Also:
-
isJoinedToTransaction
public boolean isJoinedToTransaction()Description copied from interface:SharedSessionContractCheck if the session is joined to the current transaction.- Specified by:
isJoinedToTransactionin interfaceSharedSessionContract- See Also:
-
delayedAfterCompletion
protected void delayedAfterCompletion() -
getCurrentTransaction
-
isConnected
public boolean isConnected()Description copied from interface:SharedSessionContractCheck if the session is currently connected.- Specified by:
isConnectedin interfaceSharedSessionContract- Returns:
trueif it is connected
-
getJdbcConnectionAccess
- Specified by:
getJdbcConnectionAccessin interfaceJdbcSessionOwner
-
afterObtainConnection
Description copied from interface:JdbcSessionOwnerCalled after a managed JDBC connection is obtained.Sets the schema to the schema belonging to the current tenant if:
- "hibernate.multi_tenant.schema_mapper" is enabled, and
- this session has an active tenant id.
- Specified by:
afterObtainConnectionin interfaceJdbcSessionOwner- Parameters:
connection- A JDBC connection which was just acquired- Throws:
SQLException
-
beforeReleaseConnection
Description copied from interface:JdbcSessionOwnerCalled right before a managed JDBC connection is released.Unset the schema which was set by
JdbcSessionOwner.afterObtainConnection(java.sql.Connection), if any. .- Specified by:
beforeReleaseConnectionin interfaceJdbcSessionOwner- Parameters:
connection- The JDBC connection which is about to be released- Throws:
SQLException
-
generateEntityKey
Description copied from interface:SharedSessionContractImplementorInstantiate anEntityKeywith the given id and for the entity represented by the givenEntityPersister.- Specified by:
generateEntityKeyin interfaceSharedSessionContractImplementor- Parameters:
id- The entity idpersister- The entity persister- Returns:
- The entity key
-
getSessionFactory
Description copied from interface:SharedSessionContractImplementorObtain the factory which created this session.- Specified by:
getSessionFactoryin interfaceSharedSessionContractImplementor- Specified by:
getSessionFactoryin interfaceWrapperOptions
-
useStreamForLobBinding
public boolean useStreamForLobBinding()Description copied from interface:WrapperOptionsDetermines whether streams should be used for binding LOB values.- Specified by:
useStreamForLobBindingin interfaceWrapperOptions- Returns:
true/false- See Also:
-
getPreferredSqlTypeCodeForBoolean
public int getPreferredSqlTypeCodeForBoolean()Description copied from interface:WrapperOptionsThe JDBCtype codeused to bind a null boolean value.- Specified by:
getPreferredSqlTypeCodeForBooleanin interfaceWrapperOptions- See Also:
-
getLobCreator
Description copied from interface:WrapperOptionsObtain access to theLobCreator.- Specified by:
getLobCreatorin interfaceWrapperOptions- Returns:
- The LOB creator
- See Also:
-
getDialect
Description copied from interface:SharedSessionContractImplementorObtain theDialect.- Specified by:
getDialectin interfaceSharedSessionContractImplementor- Specified by:
getDialectin interfaceWrapperOptions
-
getTypeConfiguration
Description copied from interface:SharedSessionContractImplementorObtain theTypeConfigurationfor the factory which created this session.- Specified by:
getTypeConfigurationin interfaceJavaType.CoercionContext- Specified by:
getTypeConfigurationin interfaceSharedSessionContractImplementor- Specified by:
getTypeConfigurationin interfaceWrapperOptions
-
execute
Description copied from interface:LobCreationContextExecute the given callback, making sure it has access to a viable JDBCConnection.- Specified by:
executein interfaceLobCreationContext- Type Parameters:
T- The Java type of the type of LOB being created. One ofBlob,Clob,NClob- Parameters:
callback- The callback to execute .- Returns:
- The LOB created by the callback.
-
getJdbcTimeZone
Description copied from interface:WrapperOptionsThe JDBCTimeZoneused when writing a value of typeTimeorTimestampto a JDBCPreparedStatement, or when reading from a JDBCResultSet.- When
getJdbcTimeZone()is null, the methodPreparedStatement.setTimestamp(int, java.sql.Timestamp)is called to write a timestamp, andResultSet.getTimestamp(int)is called to read a timestamp. - But when not null, the method
PreparedStatement.setTimestamp(int, java.sql.Timestamp, java.util.Calendar)is called to write a timestamp, andResultSet.getTimestamp(int, java.util.Calendar)is called to read a timestamp.
Thus, the storage
TimeZonecan differ from the default JVM TimeZone given byTimeZone.getDefault().- Specified by:
getJdbcTimeZonein interfaceWrapperOptions- Returns:
- the JDBC
TimeZone, or null if no JDBC timezone was explicitly set - See Also:
- When
-
getJdbcServices
Description copied from interface:SharedSessionContractImplementorObtain theJdbcServicesfor the factory which created this session.- Specified by:
getJdbcServicesin interfaceSharedSessionContractImplementor
-
getCacheMode
Description copied from interface:SharedSessionContractGet the current cache mode for this session.- Specified by:
getCacheModein interfaceQueryProducerImplementor- Specified by:
getCacheModein interfaceSharedSessionContract- Returns:
- the current cache mode
-
setCacheMode
Description copied from interface:SharedSessionContractSet the current cache mode for this session.The cache mode determines the manner in which this session can interact with the second level cache.
- Specified by:
setCacheModein interfaceSharedSessionContract- Parameters:
cacheMode- the new cache mode
-
setCriteriaCopyTreeEnabled
public void setCriteriaCopyTreeEnabled(boolean jpaCriteriaCopyComplianceEnabled) - Specified by:
setCriteriaCopyTreeEnabledin interfaceSharedSessionContractImplementor
-
isCriteriaCopyTreeEnabled
public boolean isCriteriaCopyTreeEnabled()- Specified by:
isCriteriaCopyTreeEnabledin interfaceSharedSessionContractImplementor
-
isCriteriaPlanCacheEnabled
public boolean isCriteriaPlanCacheEnabled()- Specified by:
isCriteriaPlanCacheEnabledin interfaceSharedSessionContractImplementor
-
setCriteriaPlanCacheEnabled
public void setCriteriaPlanCacheEnabled(boolean criteriaPlanCacheEnabled) - Specified by:
setCriteriaPlanCacheEnabledin interfaceSharedSessionContractImplementor
-
getNativeJdbcParametersIgnored
public boolean getNativeJdbcParametersIgnored()- Specified by:
getNativeJdbcParametersIgnoredin interfaceSharedSessionContractImplementor
-
setNativeJdbcParametersIgnored
public void setNativeJdbcParametersIgnored(boolean nativeJdbcParametersIgnored) - Specified by:
setNativeJdbcParametersIgnoredin interfaceSharedSessionContractImplementor
-
createQuery
Description copied from interface:QueryProducerCreate aQueryinstance for the given HQL query, or HQL insert, update, or delete statement.If a query has no explicit
selectlist, the select list is inferred:- if there is exactly one root entity in the
fromclause, and it has no non-fetchjoins, then that root entity is the only element of the select list, or - if there is an entity with the alias
this, then that entity is the only element of the select list, or - otherwise, the query is considered ambiguous, and this
method throws a
SemanticException.
The query must have an explicit
fromclause, which can never be inferred.- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor- Parameters:
queryString- The HQL query- Returns:
- The
Queryinstance for manipulation and execution - See Also:
- if there is exactly one root entity in the
-
createSelectionQuery
Description copied from interface:QueryProducerCreate aSelectionQueryreference for the given HQLselectstatement.If the statement has no explicit
selectlist, the select list is inferred:- if there is exactly one root entity in the
fromclause, and it has no non-fetchjoins, then that root entity is the only element of the select list, or - if there is an entity with the alias
this, then that entity is the only element of the select list, or - otherwise, the query is considered ambiguous, and this
method throws a
SemanticException.
The query must have an explicit
fromclause, which can never be inferred.- Specified by:
createSelectionQueryin interfaceQueryProducer
- if there is exactly one root entity in the
-
interpretHql
-
checkSelectionQuery
-
checkResultType
protected static <R> void checkResultType(Class<R> expectedResultType, SqmSelectionQueryImpl<R> query) -
createSelectionQuery
Description copied from interface:QueryProducerCreate aSelectionQueryinstance for the given HQL query string and given query result type.- If the query has a single item in the
selectlist, then the select item must be assignable to the given result type. - Otherwise, if there are multiple select items, then the
select items will be packaged into an instance of the
result type. The result type must have an appropriate
constructor with parameter types matching the select items,
or it must be one of the types
Object[],List,Map, orTuple.
If a query has no explicit
selectlist, the select list is inferred from the given query result type:- if the result type is an entity type, the query must have
exactly one root entity in the
fromclause, it must be assignable to the result type, and the inferred select list will contain just that entity, or - otherwise, the select list contains every root entity and
every non-
fetchjoined entity, and each query result will be packaged into an instance of the result type, just as specified above.
If a query has no explicit
fromclause, and the given result type is an entity type, the root entity is inferred to be the result type.Passing
Object.classas the query result type is not recommended. In this special case, this method has the same semantics as the overloadQueryProducer.createSelectionQuery(String).The returned
Querymay be executed by callingQuery.getResultList()orQuery.getSingleResult().- Specified by:
createSelectionQueryin interfaceQueryProducer- Parameters:
hqlString- The HQLselectquery as a stringexpectedResultType- TheClassobject representing the query result type, which should not beObject.class- See Also:
- If the query has a single item in the
-
createSelectionQuery
Description copied from interface:QueryProducerCreate aSelectionQueryinstance for the given HQL query string and givenEntityGraph, which is interpreted as a load graph. The query result type is the root entity of the given graph.- If the query has an explicit
selectclause, there must be a single item in theselectlist, and the select item must be assignable to the root type of the given graph. - Otherwise, if a query has no explicit
selectlist, the select list is inferred from the given entity graph. The query must have exactly one root entity in thefromclause, it must be assignable to the root type of the given graph, and the inferred select list will contain just that entity.
If a query has no explicit
fromclause, and the given result type is an entity type, the root entity is inferred to be the result type.The returned
Querymay be executed by callingQuery.getResultList()orQuery.getSingleResult().- Specified by:
createSelectionQueryin interfaceQueryProducer- Parameters:
hqlString- The HQLselectquery as a stringresultGraph- AnEntityGraphwhose root type is the query result type, which is interpreted as a load graph- See Also:
- If the query has an explicit
-
createSelectionQuery
Description copied from interface:QueryProducerCreate aSelectionQueryreference for the givenCriteriaQuery.- Specified by:
createSelectionQueryin interfaceQueryProducer- See Also:
-
createQuery
Description copied from interface:QueryProducerCreate a typedQueryinstance for the given HQL query string and given query result type.- If the query has a single item in the
selectlist, then the select item must be assignable to the given result type. - Otherwise, if there are multiple select items, then the
select items will be packaged into an instance of the
result type. The result type must have an appropriate
constructor with parameter types matching the select items,
or it must be one of the types
Object[],List,Map, orTuple.
If a query has no explicit
selectlist, the select list is inferred from the given query result type:- if the result type is an entity type, the query must have
exactly one root entity in the
fromclause, it must be assignable to the result type, and the inferred select list will contain just that entity, or - otherwise, the select list contains every root entity and
every non-
fetchjoined entity, and each query result will be packaged into an instance of the result type, just as specified above.
If a query has no explicit
fromclause, and the given result type is an entity type, the root entity is inferred to be the result type.Passing
Object.classas the query result type is not recommended. In this special case, this method has the same semantics as the overloadQueryProducer.createQuery(String).The returned
Querymay be executed by callingQuery.getResultList()orQuery.getSingleResult().- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor- Parameters:
queryString- The HQL queryexpectedResultType- TheClassobject representing the query result type, which should not beObject.class- Returns:
- The
Queryinstance for manipulation and execution - See Also:
- If the query has a single item in the
-
createQuery
Description copied from interface:QueryProducerCreate a typedQueryinstance for the given typed query reference.- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor- Parameters:
typedQueryReference- the type query reference- Returns:
- The
Queryinstance for execution - See Also:
-
createNativeQuery
Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL query.- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- a native SQL query string- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
-
createNativeQuery
Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL query using an explicit mapping to the specified Java type.The given result set mapping name must identify a mapping defined by a
SqlResultSetMappingannotation.- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- The native (SQL) query stringresultSetMappingName- The explicit result mapping name- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
-
createNativeQuery
Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL query using an implicit mapping to the specified Java type.- If the given class is an entity class, this method is equivalent
to
createNativeQuery(sqlString).addEntity(resultClass). - If the given class has a registered
JavaType, then the query must return a result set with a single column whoseJdbcTypeis compatible with thatJavaType. - Otherwise, the select items will be packaged into an instance of
the result type. The result type must have an appropriate
constructor with parameter types matching the select items, or it
must be one of the types
Object[],List,Map, orTuple.
- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- The native (SQL) query stringresultClass- The Java type to map results to- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
- If the given class is an entity class, this method is equivalent
to
-
getResultSetMappingMemento
-
requireEntityPersister
-
requireEntityPersister
-
requireCollectionPersister
-
createNativeQuery
public <T> NativeQueryImplementor<T> createNativeQuery(String sqlString, Class<T> resultClass, String tableAlias) Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL query using an implicit mapping to the specified Java entity type.The given class must be an entity class. This method is equivalent to
createNativeQuery(sqlString).addEntity(tableAlias, resultClass).- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- Native (SQL) query stringresultClass- The Java entity class to map results totableAlias- The table alias for columns in the result set- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
-
createNativeQuery
public <T> NativeQueryImplementor<T> createNativeQuery(String sqlString, String resultSetMappingName, Class<T> resultClass) Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL query using an explicit mapping to the specified Java type.The given result set mapping name must identify a mapping defined by a
SqlResultSetMappingannotation.- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- The native (SQL) query stringresultSetMappingName- The explicit result mapping name- Returns:
- The
NativeQueryinstance for manipulation and execution - See Also:
-
getNamedQuery
Deprecated.Description copied from interface:QueryProducerCreate aQueryinstance for the named query.- Specified by:
getNamedQueryin interfaceQueryProducer- Specified by:
getNamedQueryin interfaceQueryProducerImplementor- Parameters:
queryName- the name of a predefined named query- Returns:
- The
Queryinstance for manipulation and execution
-
createNamedQuery
Description copied from interface:QueryProducerCreate a typedQueryinstance for the given named query. The named query might be defined in HQL or in native SQL.- Specified by:
createNamedQueryin interfaceQueryProducer- Specified by:
createNamedQueryin interfaceQueryProducerImplementor- Parameters:
name- the name of a predefined named query- Returns:
- The
Queryinstance for manipulation and execution - See Also:
-
createNamedQuery
Description copied from interface:QueryProducerCreate a typedQueryinstance for the given named query. The named query might be defined in HQL or in native SQL.- Specified by:
createNamedQueryin interfaceQueryProducer- Specified by:
createNamedQueryin interfaceQueryProducerImplementor- Parameters:
name- the name of a query defined in metadataresultClass- the type of the query result- Returns:
- The
Queryinstance for manipulation and execution - See Also:
-
createNamedSelectionQuery
Description copied from interface:QueryProducerCreate aSelectionQueryinstance for the namedNamedQuery.- Specified by:
createNamedSelectionQueryin interfaceQueryProducer
-
createNamedSelectionQuery
public <R> SelectionQuery<R> createNamedSelectionQuery(String queryName, Class<R> expectedResultType) Description copied from interface:QueryProducerCreate aSelectionQueryinstance for the namedNamedQuerywith the given result type.- Specified by:
createNamedSelectionQueryin interfaceQueryProducer
-
doWork
Description copied from interface:SharedSessionContractPerform work using theConnectionunderlying by this session.- Specified by:
doWorkin interfaceSharedSessionContract- Parameters:
work- The work to be performed.- Throws:
HibernateException- Generally indicates wrappedSQLException
-
doReturningWork
Description copied from interface:SharedSessionContractPerform work using theConnectionunderlying by this session, and return a result.- Specified by:
doReturningWorkin interfaceSharedSessionContract- Type Parameters:
T- The type of the result returned from the work- Parameters:
work- The work to be performed.- Returns:
- the result of calling
ReturningWork.execute(java.sql.Connection). - Throws:
HibernateException- Generally indicates wrappedSQLException
-
applyQuerySettingsAndHints
-
applyQuerySettingsAndHints
-
buildNamedQuery
protected <T,Q extends CommonQueryContract> Q buildNamedQuery(String queryName, Function<NamedSqmQueryMemento<T>, Q> sqmCreator, Function<NamedNativeQueryMemento<T>, Q> nativeCreator) -
createNativeQueryImplementor
protected <T> NativeQueryImplementor<T> createNativeQueryImplementor(NamedNativeQueryMemento<T> memento) -
createSqmQueryImplementor
-
createNativeQueryImplementor
protected <T> NativeQueryImplementor<T> createNativeQueryImplementor(Class<T> resultType, NamedNativeQueryMemento<?> memento) -
createSqmQueryImplementor
protected <T> SqmQueryImplementor<T> createSqmQueryImplementor(Class<T> resultType, NamedSqmQueryMemento<?> memento) -
getNamedNativeQuery
Description copied from interface:QueryProducerGet aNativeQueryinstance for a named native SQL query- Specified by:
getNamedNativeQueryin interfaceQueryProducer- Specified by:
getNamedNativeQueryin interfaceQueryProducerImplementor- Parameters:
queryName- The name of the predefined query- Returns:
- The
NativeQueryinstance for manipulation and execution
-
getNamedNativeQuery
Description copied from interface:QueryProducerGet aNativeQueryinstance for a named native SQL query- Specified by:
getNamedNativeQueryin interfaceQueryProducer- Specified by:
getNamedNativeQueryin interfaceQueryProducerImplementor- Parameters:
queryName- The name of the predefined query- Returns:
- The
NativeQueryinstance for manipulation and execution
-
createMutationQuery
Description copied from interface:QueryProducerCreate aMutationQueryreference for the given HQL insert, update, or delete statement.- Specified by:
createMutationQueryin interfaceQueryProducer- Specified by:
createMutationQueryin interfaceQueryProducerImplementor- Parameters:
hqlString- The HQLinsert,update, ordeletestatement
-
checkMutationQuery
-
createNativeMutationQuery
Description copied from interface:QueryProducerCreate aNativeQueryinstance for the given native SQL statement.- Specified by:
createNativeMutationQueryin interfaceQueryProducer- Specified by:
createNativeMutationQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- a native SQL statement string- Returns:
- The NativeQuery instance for manipulation and execution
-
createNamedMutationQuery
Description copied from interface:QueryProducerCreate aMutationQueryinstance for the given named insert, update, or delete HQL query. The named query might be defined as HQL) or native-SQL.- Specified by:
createNamedMutationQueryin interfaceQueryProducer- Specified by:
createNamedMutationQueryin interfaceQueryProducerImplementor
-
createNativeQueryImplementor
protected <T> NativeQueryImplementor<T> createNativeQueryImplementor(String queryName, NamedNativeQueryMemento<T> memento) -
createSqmQueryImplementor
protected <T> SqmQueryImplementor<T> createSqmQueryImplementor(String queryName, NamedSqmQueryMemento<T> memento) -
createMutationQuery
Description copied from interface:QueryProducerCreate aMutationQueryfrom the given update criteria tree- Specified by:
createMutationQueryin interfaceQueryProducer- Specified by:
createMutationQueryin interfaceQueryProducerImplementor
-
createMutationQuery
Description copied from interface:QueryProducerCreate aMutationQueryfrom the given delete criteria tree- Specified by:
createMutationQueryin interfaceQueryProducer- Specified by:
createMutationQueryin interfaceQueryProducerImplementor
-
createMutationQuery
Description copied from interface:QueryProducerCreate aMutationQueryfrom the given insert criteria tree- Specified by:
createMutationQueryin interfaceQueryProducer
-
getNamedProcedureCall
Description copied from interface:SharedSessionContractObtain aProcedureCallbased on a named template- Specified by:
getNamedProcedureCallin interfaceSharedSessionContract- Parameters:
name- The name given to the template- Returns:
- The ProcedureCall
- See Also:
-
createNamedStoredProcedureQuery
Description copied from interface:SharedSessionContractObtain aProcedureCallbased on a named template- Specified by:
createNamedStoredProcedureQueryin interfaceSharedSessionContract- Parameters:
name- The name given to the template- Returns:
- The ProcedureCall
- See Also:
-
createStoredProcedureCall
Description copied from interface:SharedSessionContractCreate aProcedureCallto a stored procedure.- Specified by:
createStoredProcedureCallin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.- Returns:
- The representation of the procedure call.
-
createStoredProcedureCall
Description copied from interface:SharedSessionContractCreate aProcedureCallto a stored procedure with the given result set entity mappings. Each given class is considered a "root return".- Specified by:
createStoredProcedureCallin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.resultClasses- The entity(s) to map the result on to.- Returns:
- The representation of the procedure call.
-
createStoredProcedureCall
Description copied from interface:SharedSessionContractCreate aProcedureCallto a stored procedure with the given result set entity mappings.- Specified by:
createStoredProcedureCallin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.resultSetMappings- The explicit result set mapping(s) to use for mapping the results- Returns:
- The representation of the procedure call.
-
createStoredProcedureQuery
Description copied from interface:SharedSessionContractCreate aProcedureCallto a stored procedure.- Specified by:
createStoredProcedureQueryin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.- Returns:
- The representation of the procedure call.
-
createStoredProcedureQuery
Description copied from interface:SharedSessionContractCreate aProcedureCallto a stored procedure with the given result set entity mappings. Each given class is considered a "root return".- Specified by:
createStoredProcedureQueryin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.resultClasses- The entity(s) to map the result on to.- Returns:
- The representation of the procedure call.
-
createStoredProcedureQuery
Description copied from interface:SharedSessionContractCreate aProcedureCallto a stored procedure with the given result set entity mappings.- Specified by:
createStoredProcedureQueryin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.resultSetMappings- The explicit result set mapping(s) to use for mapping the results- Returns:
- The representation of the procedure call.
-
getExceptionConverter
Description copied from interface:SharedSessionContractImplementorObtain anExceptionConverterfor reporting an error.The converter associated to a session might be lazily initialized, so only invoke this getter when there's an actual need to use it.
- Specified by:
getExceptionConverterin interfaceSharedSessionContractImplementor- Returns:
- the ExceptionConverter for this Session.
-
getJdbcBatchSize
Description copied from interface:SharedSessionContractGet the session-level JDBC batch size for the current session.- Specified by:
getJdbcBatchSizein interfaceJdbcSessionOwner- Specified by:
getJdbcBatchSizein interfaceSharedSessionContract- Returns:
- the current session-level JDBC batch size
- See Also:
-
setJdbcBatchSize
Description copied from interface:SharedSessionContractSet the session-level JDBC batch size. Override the factory-level JDBC batch size controlled by the configuration property "hibernate.jdbc.batch_size".- Specified by:
setJdbcBatchSizein interfaceSharedSessionContract- Parameters:
jdbcBatchSize- the new session-level JDBC batch size- See Also:
-
getEventMonitor
Description copied from interface:JdbcSessionOwnerObtain a reference to theEventMonitor.- Specified by:
getEventMonitorin interfaceJdbcSessionOwner
-
getCriteriaBuilder
Description copied from interface:SharedSessionContract- Specified by:
getCriteriaBuilderin interfaceSharedSessionContract- Returns:
- an instance of
HibernateCriteriaBuilder - See Also:
-
createQuery
Description copied from interface:QueryProducerCreate aQueryfor the given JPACriteriaQuery.- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor
-
createQuery
Description copied from interface:QueryProducerCreate aMutationQueryfor the given JPACriteriaUpdate- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor
-
createQuery
Description copied from interface:QueryProducerCreate aMutationQueryfor the given JPACriteriaDelete- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor
-
createCriteriaQuery
protected <T> QueryImplementor<T> createCriteriaQuery(SqmStatement<T> criteria, Class<T> resultType) -
createEntityGraph
Description copied from interface:SharedSessionContractCreate a new mutable instance ofEntityGraph, with only a root node, allowing programmatic definition of the graph from scratch.- Specified by:
createEntityGraphin interfaceSharedSessionContract- Specified by:
createEntityGraphin interfaceSharedSessionContractImplementor- Parameters:
rootType- the root entity class of the graph- See Also:
-
createEntityGraph
Description copied from interface:SharedSessionContractCreate a new mutable instance ofEntityGraph, based on a predefined named entity graph, allowing customization of the graph, or returnnullif there is no predefined graph with the given name.- Specified by:
createEntityGraphin interfaceSharedSessionContract- Parameters:
rootType- the root entity class of the graphgraphName- the name of the predefined named entity graph- See Also:
-
createEntityGraph
Description copied from interface:SharedSessionContractCreate a new mutable instance ofEntityGraph, based on a predefined named entity graph, allowing customization of the graph, or returnnullif there is no predefined graph with the given name.- Specified by:
createEntityGraphin interfaceSharedSessionContract- Specified by:
createEntityGraphin interfaceSharedSessionContractImplementor- Parameters:
graphName- the name of the graph- See Also:
-
getEntityGraph
Description copied from interface:SharedSessionContractObtain an immutable reference to a predefined named entity graph.- Specified by:
getEntityGraphin interfaceSharedSessionContract- Specified by:
getEntityGraphin interfaceSharedSessionContractImplementor- Parameters:
graphName- the name of the predefined named entity graph- See Also:
-
getEntityGraphs
Description copied from interface:SharedSessionContractRetrieve all namedEntityGraphs with the given root entity type.- Specified by:
getEntityGraphsin interfaceSharedSessionContract- See Also:
-
getEnabledFilter
Description copied from interface:SharedSessionContractRetrieve a currently enabled filter by name.- Specified by:
getEnabledFilterin interfaceSharedSessionContract- Parameters:
filterName- the name of the filter to be retrieved.- Returns:
- the
Filterinstance representing the enabled filter.
-
enableFilter
Description copied from interface:SharedSessionContractEnable the named filter for this current session.The returned
Filterobject must be used to bind arguments to parameters of the filter, and every parameter must be set before any other operation of this session is called.- Specified by:
enableFilterin interfaceSharedSessionContract- Parameters:
filterName- the name of the filter to be enabled.- Returns:
- the
Filterinstance representing the enabled filter. - See Also:
-
disableFilter
Description copied from interface:SharedSessionContractDisable the named filter for the current session.- Specified by:
disableFilterin interfaceSharedSessionContract- Parameters:
filterName- the name of the filter to be disabled.
-
getXmlFormatMapper
Description copied from interface:WrapperOptionsObtain the XMLFormatMapper.- Specified by:
getXmlFormatMapperin interfaceWrapperOptions
-
getJsonFormatMapper
Description copied from interface:WrapperOptionsObtain the JSONFormatMapper.- Specified by:
getJsonFormatMapperin interfaceWrapperOptions
-
getSessionAssociationMarkers
Description copied from interface:SharedSessionContractImplementorWrap all state that lazy loading interceptors might need to manage association with this session, or to handle lazy loading after detachment via the UUID of the SessionFactory. N.B. this captures the current Session, however it can get updated to a null session (for detached entities) or updated to a different Session.- Specified by:
getSessionAssociationMarkersin interfaceSharedSessionContractImplementor
-