Top Description Fields Constructors Methods
org.hibernate.engine.spi

public Class SharedSessionDelegatorBaseImpl

extends Object
implements SharedSessionContractImplementor
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.type.descriptor.java.JavaType.CoercionContext, org.hibernate.query.spi.QueryProducerImplementor, org.hibernate.query.QueryProducer, org.hibernate.type.descriptor.WrapperOptions, org.hibernate.engine.jdbc.LobCreationContext, org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder.Options, org.hibernate.resource.jdbc.spi.JdbcSessionOwner, org.hibernate.SharedSessionContract, java.io.Serializable, java.io.Closeable, java.lang.AutoCloseable
Annotations
@SuppressWarnings:deprecation
Imports
jakarta.persistence.EntityGraph, .FlushModeType, jakarta.persistence.criteria.CriteriaDelete, .CriteriaQuery, .CriteriaUpdate, org.checkerframework.checker.nullness.qual.Nullable, org.hibernate.CacheMode, .FlushMode, .HibernateException, .Interceptor, .SharedSessionContract, .Transaction, org.hibernate.cache.spi.CacheTransactionSynchronization, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.jdbc.LobCreator, org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess, org.hibernate.engine.jdbc.spi.JdbcCoordinator, .JdbcServices, org.hibernate.event.spi.EventManager, org.hibernate.graph.RootGraph, org.hibernate.jdbc.ReturningWork, .Work, org.hibernate.persister.entity.EntityPersister, org.hibernate.procedure.ProcedureCall, org.hibernate.query.MutationQuery, .SelectionQuery, org.hibernate.query.criteria.HibernateCriteriaBuilder, .JpaCriteriaInsertSelect, org.hibernate.query.spi.QueryImplementor, .QueryProducerImplementor, org.hibernate.query.sql.spi.NativeQueryImplementor, org.hibernate.resource.jdbc.spi.JdbcSessionContext, org.hibernate.resource.transaction.spi.TransactionCoordinator, java.util.List, .Set, .TimeZone, .UUID

A wrapper class that delegates all method invocations to a delegate instance of SharedSessionContractImplementor. This is useful for custom implementations of that API, so that only some methods need to be overridden
Author
Gavin King

Field Summary

Modifier and TypeField and Description
protected final SharedSessionContractImplementor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Transaction
accessTransaction()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.accessTransaction.

Retrieves the current Transaction, or creates a new transaction if there is no transaction active.
public void
afterOperation(boolean
true if the operation a success
success
)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.afterOperation.

Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, making sure that the connection has been committed (if it is not in autocommit mode), and finally run the after completion processing.
public void
afterScrollOperation()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.afterScrollOperation.

Called after each operation on a org.hibernate.ScrollableResults, providing an opportunity for a stateless session to clear its temporary persistence context.
public void
afterTransactionBegin()

Implements org.hibernate.resource.jdbc.spi.JdbcSessionOwner.afterTransactionBegin.

A after-begin callback from the coordinator to its owner.
public void
afterTransactionCompletion(boolean
Was the transaction successful?
successful
,
boolean
Is this a delayed after transaction completion call (aka after a timeout)?
delayed
)

Implements org.hibernate.resource.jdbc.spi.JdbcSessionOwner.afterTransactionCompletion.

An after-completion callback to the owner.
public boolean
autoFlushIfRequired(Set<String>
the tables named in the query.
querySpaces
)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.autoFlushIfRequired.

detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flush
public void
public Transaction
beginTransaction()

Implements org.hibernate.SharedSessionContract.beginTransaction.

Begin a unit of work and return the associated Transaction object.
public String
bestGuessEntityName(Object object)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.bestGuessEntityName.

Obtain the best estimate of the entity name of the given entity instance, which is not involved in an association, by also considering information held in the proxy, and whether the object is already associated with this session.
public void
checkOpen(boolean markForRollbackIfClosed)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.checkOpen.

Check 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.)
public void
close()

Implements org.hibernate.SharedSessionContract.close.

End the session by releasing the JDBC connection and cleaning up.
public <T> RootGraph<T>
createEntityGraph(Class<T>
the root entity class of the graph
rootType
)

Implements org.hibernate.SharedSessionContract.createEntityGraph.

Create a new mutable EntityGraph with only a root node.
public RootGraph<?>
createEntityGraph(String
the name of the graph
graphName
)

Implements org.hibernate.SharedSessionContract.createEntityGraph.

Create a new mutable copy of the named EntityGraph, or return null if there is no graph with the given name.
public <T> RootGraph<T>
createEntityGraph(Class<T>
the root entity class of the graph
rootType
,
String
the name of the graph
graphName
)

Implements org.hibernate.SharedSessionContract.createEntityGraph.

Create a new mutable copy of the named EntityGraph, or return null if there is no graph with the given name.
public MutationQuery
public MutationQuery
public MutationQuery
createMutationQuery(JpaCriteriaInsertSelect<T> insertSelect)

Implements org.hibernate.query.QueryProducer.createMutationQuery.

Create a MutationQuery from the given insert-select criteria tree
public MutationQuery
createMutationQuery(String statementString)

Implements org.hibernate.query.QueryProducer.createMutationQuery, org.hibernate.query.spi.QueryProducerImplementor.createMutationQuery.

Create a MutationQuery reference for the given HQL insert, update, or delete statement.
public MutationQuery
public QueryImplementor<R>
createNamedQuery(String
the name of a predefined named query
name
)

Implements org.hibernate.query.QueryProducer.createNamedQuery, org.hibernate.query.spi.QueryProducerImplementor.createNamedQuery.

Create a typed Query instance for the given named query.
public <T> QueryImplementor<T>
createNamedQuery(String
the name of a query defined in metadata
name
,
Class<T>
the type of the query result
resultClass
)

Implements org.hibernate.query.QueryProducer.createNamedQuery, org.hibernate.query.spi.QueryProducerImplementor.createNamedQuery.

Create a typed Query instance for the given named query.
public SelectionQuery<?>
public <R> SelectionQuery<R>
createNamedSelectionQuery(String name, Class<R> resultType)

Implements org.hibernate.query.QueryProducer.createNamedSelectionQuery.

Create a SelectionQuery instance for the named jakarta.persistence.NamedQuery with the given result type.
public ProcedureCall
createNamedStoredProcedureQuery(String
The name given to the template
name
)

Implements org.hibernate.SharedSessionContract.createNamedStoredProcedureQuery.

Obtain a ProcedureCall based on a named template
public MutationQuery
public NativeQueryImplementor<R>
createNativeQuery(String
a native SQL query string
sqlString
)

Implements org.hibernate.query.QueryProducer.createNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.createNativeQuery.

Create a NativeQuery instance for the given native SQL query.
public NativeQueryImplementor<R>
createNativeQuery(String
The native (SQL) query string
sqlString
,
Class<T>
The Java type to map results to
resultClass
)

Implements org.hibernate.query.QueryProducer.createNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.createNativeQuery.

Create a NativeQuery instance for the given native SQL query using an implicit mapping to the specified Java type.
public <T> NativeQueryImplementor<T>
createNativeQuery(String
Native (SQL) query string
sqlString
,
Class<T>
The Java entity class to map results to
resultClass
,
String
The table alias for columns in the result set
tableAlias
)

Implements org.hibernate.query.QueryProducer.createNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.createNativeQuery.

Create a NativeQuery instance for the given native SQL query using an implicit mapping to the specified Java entity type.
public NativeQueryImplementor<R>
createNativeQuery(String
The native (SQL) query string
sqlString
,
String
The explicit result mapping name
resultSetMappingName
)

Implements org.hibernate.query.QueryProducer.createNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.createNativeQuery.

Create a NativeQuery instance for the given native SQL query using an explicit mapping to the specified Java type.
public <T> NativeQueryImplementor<T>
createNativeQuery(String
The native (SQL) query string
sqlString
,
String
The explicit result mapping name
resultSetMappingName
,
Class<T> resultClass)

Implements org.hibernate.query.QueryProducer.createNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.createNativeQuery.

Create a NativeQuery instance for the given native SQL query using an explicit mapping to the specified Java type.
public <T> QueryImplementor<T>
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
createQuery(String
The HQL query
queryString
)

Implements org.hibernate.query.QueryProducer.createQuery, org.hibernate.query.spi.QueryProducerImplementor.createQuery.

Create a Query instance for the given HQL query, or HQL insert, update, or delete statement.
public <T> QueryImplementor<T>
createQuery(String
The HQL query
queryString
,
Class<T>
The type of the query result
resultType
)

Implements org.hibernate.query.QueryProducer.createQuery, org.hibernate.query.spi.QueryProducerImplementor.createQuery.

Create a typed Query instance for the given HQL query string and given query result type.
public SelectionQuery<?>
createSelectionQuery(String hqlString)

Implements org.hibernate.query.QueryProducer.createSelectionQuery.

Create a SelectionQuery reference for the given HQL select statement.
public <R> SelectionQuery<R>
createSelectionQuery(String
The HQL query as a string
hqlString
,
Class<R>
The Class object representing the query result type
resultType
)

Implements org.hibernate.query.QueryProducer.createSelectionQuery.

Create a SelectionQuery instance for the given HQL query string and given query result type.
public <R> SelectionQuery<R>
public ProcedureCall
createStoredProcedureCall(String
The name of the procedure.
procedureName
)

Implements org.hibernate.SharedSessionContract.createStoredProcedureCall.

Create a ProcedureCall to a stored procedure.
public ProcedureCall
createStoredProcedureCall(String
The name of the procedure.
procedureName
,
Class<?>...
The entity(s) to map the result on to.
resultClasses
)

Implements org.hibernate.SharedSessionContract.createStoredProcedureCall.

Create a ProcedureCall to a stored procedure with the given result set entity mappings.
public ProcedureCall
createStoredProcedureCall(String
The name of the procedure.
procedureName
,
String...
The explicit result set mapping(s) to use for mapping the results
resultSetMappings
)

Implements org.hibernate.SharedSessionContract.createStoredProcedureCall.

Create a ProcedureCall to a stored procedure with the given result set entity mappings.
public ProcedureCall
createStoredProcedureQuery(String
The name of the procedure.
procedureName
)

Implements org.hibernate.SharedSessionContract.createStoredProcedureQuery.

Create a ProcedureCall to a stored procedure.
public ProcedureCall
createStoredProcedureQuery(String
The name of the procedure.
procedureName
,
Class<?>...
The entity(s) to map the result on to.
resultClasses
)

Implements org.hibernate.SharedSessionContract.createStoredProcedureQuery.

Create a ProcedureCall to a stored procedure with the given result set entity mappings.
public ProcedureCall
createStoredProcedureQuery(String
The name of the procedure.
procedureName
,
String...
The explicit result set mapping(s) to use for mapping the results
resultSetMappings
)

Implements org.hibernate.SharedSessionContract.createStoredProcedureQuery.

Create a ProcedureCall to a stored procedure with the given result set entity mappings.
protected SharedSessionContract
delegate()

Returns the delegate session.

public <T> T
doReturningWork(ReturningWork<T>
The work to be performed.
work
)

Overrides default org.hibernate.SharedSessionContract.doReturningWork.

Perform work using the java.sql.Connection underlying by this session, and return a result.
public void
doWork(Work
The work to be performed.
work
)

Overrides default org.hibernate.SharedSessionContract.doWork.

Perform work using the java.sql.Connection underlying by this session.
public <T> T
execute(LobCreationContext.Callback<T>
The callback to execute .
callback
)

Implements org.hibernate.engine.jdbc.LobCreationContext.execute.

Execute the given callback, making sure it has access to a viable JDBC Connection.
public void
public void
public EntityKey
generateEntityKey(Object
The entity id
id
,
EntityPersister
The entity persister
persister
)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.generateEntityKey.

Instantiate an EntityKey with the given id and for the entity represented by the given EntityPersister.
public CacheMode
public CacheTransactionSynchronization
public Object
getContextEntityIdentifier(Object object)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getContextEntityIdentifier.

Return the identifier of the persistent object, or null if it is not associated with this session.
public HibernateCriteriaBuilder
public RootGraph<?>
getEntityGraph(String
the name of the graph
graphName
)

Implements org.hibernate.SharedSessionContract.getEntityGraph.

Retrieve the named EntityGraph as an immutable graph, or return null if there is no graph with the given name.
public <T> List<EntityGraph<? super T>>
getEntityGraphs(Class<T> entityClass)

Implements org.hibernate.SharedSessionContract.getEntityGraphs.

Retrieve all named EntityGraphs with the given type.
public EntityPersister
public Object
getEntityUsingInterceptor(EntityKey key)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getEntityUsingInterceptor.

Get the entity instance associated with the given EntityKey, calling the Interceptor if necessary.
public SessionEventListenerManager
public EventManager
public ExceptionConverter
public SessionFactoryImplementor
getFactory()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Obtain the factory which created this session.
public FlushModeType
public FlushMode
public Interceptor
public Integer
public JdbcConnectionAccess
public JdbcCoordinator
public JdbcServices
getJdbcServices()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getJdbcServices.

Obtain the JdbcServices for the factory which created this session.
public JdbcSessionContext
public TimeZone
getJdbcTimeZone()

Implements org.hibernate.type.descriptor.WrapperOptions.getJdbcTimeZone.

The JDBC TimeZone used when writing a value of type java.sql.Time or java.sql.Timestamp to a JDBC java.sql.PreparedStatement, or when reading from a JDBC java.sql.ResultSet.
public LoadQueryInfluencers
public LobCreator
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
getNamedNativeQuery(String
The name of the predefined query
name
,
String resultSetMapping)

Implements org.hibernate.query.QueryProducer.getNamedNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.getNamedNativeQuery.

Get a NativeQuery instance for a named native SQL query
public ProcedureCall
getNamedProcedureCall(String
The name given to the template
name
)

Implements org.hibernate.SharedSessionContract.getNamedProcedureCall.

Obtain a ProcedureCall based on a named template
public QueryImplementor<R>
getNamedQuery(String
the name of a predefined named query
name
)

Implements org.hibernate.query.QueryProducer.getNamedQuery, org.hibernate.query.spi.QueryProducerImplementor.getNamedQuery.

Create a Query instance for the named query.
public boolean
public PersistenceContext
public PersistenceContext
getPersistenceContextInternal()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getPersistenceContextInternal.

Similar to getPersistenceContext(), with two differences:
  1. this version performs better as it allows for inlining and probably better prediction, and
  2. it skips some checks of the current state of the session.
public int
public UUID
public String
getTenantIdentifier()

Implements org.hibernate.SharedSessionContract.getTenantIdentifier.

Obtain the tenant identifier associated with this session.
public Object
getTenantIdentifierValue()

Implements org.hibernate.SharedSessionContract.getTenantIdentifierValue.

Obtain the tenant identifier associated with this session.
public Transaction
getTransaction()

Implements org.hibernate.SharedSessionContract.getTransaction.

Get the Transaction instance associated with this session.
public TransactionCoordinator
getTransactionCoordinator()

Implements org.hibernate.resource.jdbc.spi.JdbcSessionOwner.getTransactionCoordinator.

Obtain the builder for TransactionCoordinator instances
public String
guessEntityName(Object entity)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.guessEntityName.

Obtain an estimate of the entity name of the given entity instance, which is not involved in an association, using only the org.hibernate.EntityNameResolver.
public Object
public void
initializeCollection(PersistentCollection<?> collection, boolean writing)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.initializeCollection.

Initialize the given collection (if not already initialized).
public Object
instantiate(String entityName, Object id)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.instantiate.

Instantiate the entity class, initializing with the given identifier.
public Object
instantiate(EntityPersister persister, Object id)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.instantiate.

Instantiate the entity class of the given EntityPersister, initializing the new instance with the given identifier.
public Object
internalLoad(String entityName, Object id, boolean eager, boolean nullable)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.internalLoad.

Obtain an entity instance with the given id, without checking if it was deleted or scheduled for deletion.
public boolean
public boolean
isClosed()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.isClosed.

Determines whether the session is closed.
public boolean
isConnected()

Implements org.hibernate.SharedSessionContract.isConnected.

Check if the session is currently connected.
public boolean
public boolean
isDefaultReadOnly()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.isDefaultReadOnly.

Are entities and proxies loaded by this session read-only by default?
public boolean
isJoinedToTransaction()

Implements org.hibernate.SharedSessionContract.isJoinedToTransaction.

Check if the session is joined to the current transaction.
public boolean
isOpen()

Implements org.hibernate.SharedSessionContract.isOpen.

Check if the session is still open.
public boolean
isTransactionInProgress()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.isTransactionInProgress.

Does this session have an active Hibernate transaction, or is it associated with a JTA transaction currently in progress?
public void
joinTransaction()

Implements org.hibernate.SharedSessionContract.joinTransaction.

Join the currently-active JTA transaction.
public void
markForRollbackOnly()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.markForRollbackOnly.

Marks current transaction, if any, for rollback only.
public void
private QueryProducerImplementor
public void
setAutoClear(boolean enabled)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.setAutoClear.

Enable or disable automatic cache clearing from after transaction completion.
public void
public void
public void
public void
setJdbcBatchSize(Integer
the new session-level JDBC batch size
jdbcBatchSize
)

Implements org.hibernate.SharedSessionContract.setJdbcBatchSize.

Set the session-level JDBC batch size.
public void
public boolean
shouldAutoClose()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.shouldAutoClose.

Should this session be automatically closed after the current transaction completes?
public boolean
shouldAutoJoinTransaction()

Implements org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder.Options.shouldAutoJoinTransaction.

Indicates whether an active transaction should be automatically joined.
public void
startTransactionBoundary()

Implements org.hibernate.resource.jdbc.spi.JdbcSessionOwner.startTransactionBoundary.

Callback indicating recognition of entering into a transactional context whether that is explicitly via the Hibernate org.hibernate.Transaction API or via registration of Hibernate's JTA Synchronization impl with a JTA Transaction
public boolean
useStreamForLobBinding()

Implements org.hibernate.type.descriptor.WrapperOptions.useStreamForLobBinding.

Determines whether streams should be used for binding LOB values.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait