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

public Class SessionDelegatorBaseImpl

extends Object
implements SessionImplementor
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.spi.SessionImplementor, 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, org.hibernate.Session, jakarta.persistence.EntityManager
Annotations
@SuppressWarnings:deprecation
Imports
java.util.List, .Map, .Set, .TimeZone, .UUID, jakarta.persistence.CacheRetrieveMode, .CacheStoreMode, .EntityGraph, .EntityManagerFactory, .FlushModeType, .LockModeType, org.hibernate.CacheMode, .Filter, .FlushMode, .HibernateException, .IdentifierLoadAccess, .Interceptor, .LobHelper, .LockMode, .LockOptions, .MultiIdentifierLoadAccess, .NaturalIdLoadAccess, .NaturalIdMultiLoadAccess, .ReplicationMode, .SessionEventListener, .SharedSessionBuilder, .SimpleNaturalIdLoadAccess, .Transaction, .UnknownProfileException, 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, .DeleteContext, .EventSource, .MergeContext, .PersistContext, .RefreshContext, org.hibernate.graph.RootGraph, org.hibernate.graph.spi.RootGraphImplementor, 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, org.hibernate.stat.SessionStatistics, jakarta.persistence.criteria.CriteriaDelete, .CriteriaQuery, .CriteriaUpdate, jakarta.persistence.metamodel.Metamodel, org.checkerframework.checker.nullness.qual.Nullable

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

(Used by Hibernate Search).

Author
Sanne Grinovero

Field Summary

Modifier and TypeField and Description
protected final SessionImplementor

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
addEventListeners(SessionEventListener...
the listener(s) to add
listeners
)

Implements org.hibernate.Session.addEventListeners.

Add one or more listeners to the Session
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 EventSource
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 Session.LockRequest
buildLockRequest(LockOptions
contains the lock level
lockOptions
)

Implements org.hibernate.Session.buildLockRequest.

Deprecated
Build a new lock request that specifies:
public <T> IdentifierLoadAccess<T>
byId(String
the entity name of the entity type to be retrieved
entityName
)

Implements org.hibernate.Session.byId.

Create an IdentifierLoadAccess instance to retrieve an instance of the named entity type by its primary key.
public <T> IdentifierLoadAccess<T>
byId(Class<T>
the entity type to be retrieved
entityClass
)

Implements org.hibernate.Session.byId.

Create an IdentifierLoadAccess instance to retrieve an instance of the given entity type by its primary key.
public <T> MultiIdentifierLoadAccess<T>
byMultipleIds(Class<T>
the entity type to be retrieved
entityClass
)

Implements org.hibernate.Session.byMultipleIds.

Create a MultiIdentifierLoadAccess instance to retrieve multiple instances of the given entity type by their primary key values, using batching.
public <T> MultiIdentifierLoadAccess<T>
byMultipleIds(String
the entity name of the entity type to be retrieved
entityName
)

Implements org.hibernate.Session.byMultipleIds.

Create a MultiIdentifierLoadAccess instance to retrieve multiple instances of the named entity type by their primary key values, using batching.
public <T> NaturalIdMultiLoadAccess<T>
byMultipleNaturalId(Class<T>
the entity type to be retrieved
entityClass
)

Implements org.hibernate.Session.byMultipleNaturalId.

Create a MultiIdentifierLoadAccess instance to retrieve multiple instances of the given entity type by their by natural id values, using batching.
public <T> NaturalIdMultiLoadAccess<T>
byMultipleNaturalId(String
the entity name of the entity type to be retrieved
entityName
)

Implements org.hibernate.Session.byMultipleNaturalId.

Create a MultiIdentifierLoadAccess instance to retrieve multiple instances of the named entity type by their by natural id values, using batching.
public <T> NaturalIdLoadAccess<T>
byNaturalId(String
the entity name of the entity type to be retrieved
entityName
)

Implements org.hibernate.Session.byNaturalId.

Create a NaturalIdLoadAccess instance to retrieve an instance of the named entity type by its natural id, which may be a composite natural id. The entity must have at least one attribute annotated org.hibernate.annotations.NaturalId.
public <T> NaturalIdLoadAccess<T>
byNaturalId(Class<T>
the entity type to be retrieved
entityClass
)

Implements org.hibernate.Session.byNaturalId.

Create a NaturalIdLoadAccess instance to retrieve an instance of the given entity type by its natural id, which may be a composite natural id. The entity must have at least one attribute annotated org.hibernate.annotations.NaturalId.
public <T> SimpleNaturalIdLoadAccess<T>
bySimpleNaturalId(String
the entity name of the entity type to be retrieved
entityName
)

Implements org.hibernate.Session.bySimpleNaturalId.

Create a SimpleNaturalIdLoadAccess instance to retrieve an instance of the named entity type by its natural id, which must be a simple (non-composite) value.
public <T> SimpleNaturalIdLoadAccess<T>
bySimpleNaturalId(Class<T>
the entity type to be retrieved
entityClass
)

Implements org.hibernate.Session.bySimpleNaturalId.

Create a SimpleNaturalIdLoadAccess instance to retrieve an instance of the given entity type by its natural id, which must be a simple (non-composite) value.
public void
cancelQuery()

Implements org.hibernate.Session.cancelQuery.

Cancel the execution of the current query.
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
checkOpen()

Overrides default org.hibernate.engine.spi.SharedSessionContractImplementor.checkOpen.

Check whether the session is open, and if not:
  • mark the current transaction, if any, for rollback only, and
  • throw an IllegalStateException. (JPA specifies this exception type.)
public void
checkTransactionNeededForUpdateOperation(String
the message to use for the TransactionRequiredException
exceptionMessage
)

Overrides default org.hibernate.engine.spi.SharedSessionContractImplementor.checkTransactionNeededForUpdateOperation.

Check if an active Transaction is available before performing an update operation against the database.
public void
clear()

Implements org.hibernate.Session.clear.

Completely clear the session.
public void
close()

Implements org.hibernate.SharedSessionContract.close, jakarta.persistence.EntityManager.close.

End the session by releasing the JDBC connection and cleaning up.
public boolean
contains(String
the entity name
entityName
,
Object
an instance of a persistent class
object
)

Implements org.hibernate.Session.contains.

Determine if the given entity is associated with this session.
public boolean
contains(Object
entity instance
object
)

Implements jakarta.persistence.EntityManager.contains.

Check if the instance is a managed entity instance belonging to the current persistence context.
public <T> RootGraphImplementor<T>
createEntityGraph(Class<T>
the root entity class of the graph
rootType
)

Implements org.hibernate.engine.spi.SessionImplementor.createEntityGraph.

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

Implements org.hibernate.engine.spi.SessionImplementor.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 query defined in metadata
name
)

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

Create an instance of Query for executing a named query (in the Jakarta Persistence query language or in native SQL).
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.Session.createNamedQuery, org.hibernate.query.QueryProducer.createNamedQuery, org.hibernate.query.spi.QueryProducerImplementor.createNamedQuery.

Create an instance of TypedQuery for executing a Jakarta Persistence query language 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
public MutationQuery
public NativeQueryImplementor<R>
createNativeQuery(String
a native SQL query string
sqlString
)

Implements org.hibernate.query.QueryProducer.createNativeQuery, jakarta.persistence.EntityManager.createNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.createNativeQuery.

Create an instance of Query for executing a native SQL statement, e.g., for update or delete.
public NativeQueryImplementor<R>
createNativeQuery(String
a native SQL query string
sqlString
,
Class<T>
the class of the resulting instance(s)
resultClass
)

Implements org.hibernate.query.QueryProducer.createNativeQuery, jakarta.persistence.EntityManager.createNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.createNativeQuery.

Create an instance of Query for executing a native SQL query.
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
a native SQL query string
sqlString
,
String
the name of the result set mapping
resultSetMappingName
)

Implements org.hibernate.query.QueryProducer.createNativeQuery, jakarta.persistence.EntityManager.createNativeQuery, org.hibernate.query.spi.QueryProducerImplementor.createNativeQuery.

Create an instance of Query for executing a native SQL query.
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>
createQuery(CriteriaQuery<T>
a criteria query object
criteriaQuery
)

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

Create an instance of TypedQuery for executing a criteria query.
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
createQuery(String
a Jakarta Persistence query string
queryString
)

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

Create an instance of Query for executing a Jakarta Persistence query language statement.
public <T> QueryImplementor<T>
createQuery(String
a Jakarta Persistence query string
queryString
,
Class<T>
the type of the query result
resultType
)

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

Create an instance of TypedQuery for executing a Jakarta Persistence query language statement.
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
public ProcedureCall
createStoredProcedureQuery(String
The name of the procedure.
procedureName
,
Class<T>...
The entity(s) to map the result on to.
resultClasses
)

Implements org.hibernate.SharedSessionContract.createStoredProcedureQuery, jakarta.persistence.EntityManager.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, jakarta.persistence.EntityManager.createStoredProcedureQuery.

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

Returns the delegate session.

public void
delete(Object
the instance to be removed
object
)

Implements org.hibernate.Session.delete.

Remove a persistent instance from the datastore.
public void
delete(String
the entity name for the instance to be removed.
entityName
,
Object
the instance to be removed
object
)

Implements org.hibernate.Session.delete.

Remove a persistent instance from the datastore.
public void
delete(String entityName, Object child, boolean isCascadeDeleteEnabled, DeleteContext transientEntities)

Implements org.hibernate.engine.spi.SessionImplementor.delete.

public void
detach(Object
the managed instance to detach
entity
)

Implements org.hibernate.Session.detach.

Remove this instance from the session cache.
public void
disableFetchProfile(String
the name of the fetch profile to be disabled
name
)

Implements org.hibernate.Session.disableFetchProfile.

Disable the fetch profile with the given name in this session.
public void
disableFilter(String
the name of the filter to be disabled.
filterName
)

Implements org.hibernate.Session.disableFilter.

Disable the named filter for the current 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 void
enableFetchProfile(String
the name of the fetch profile to be enabled
name
)

Implements org.hibernate.Session.enableFetchProfile.

Enable the fetch profile with the given name in this session.
public Filter
enableFilter(String
the name of the filter to be enabled.
filterName
)

Implements org.hibernate.Session.enableFilter.

Enable the named filter for this current session.
public void
evict(Object
the managed entity to evict
object
)

Implements org.hibernate.Session.evict.

Remove this instance from the session cache.
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 <T> @Nullable T
find(Class<T>
entity class
entityClass
,
Object
primary key
primaryKey
)

Implements jakarta.persistence.EntityManager.find.

Find by primary key.
public <T> @Nullable T
find(Class<T>
entity class
entityClass
,
Object
primary key
primaryKey
,
Map<String, Object>
standard and vendor-specific properties and hints
properties
)

Implements jakarta.persistence.EntityManager.find.

Find by primary key, using the specified properties.
public <T> @Nullable T
find(Class<T>
entity class
entityClass
,
Object
primary key
primaryKey
,
LockModeType
lock mode
lockMode
)

Implements jakarta.persistence.EntityManager.find.

Find by primary key and lock.
public <T> @Nullable T
find(Class<T>
entity class
entityClass
,
Object
primary key
primaryKey
,
LockModeType
lock mode
lockMode
,
Map<String, Object>
standard and vendor-specific properties and hints
properties
)

Implements jakarta.persistence.EntityManager.find.

Find by primary key and lock, using the specified properties.
public void
public void
public void
forceFlush(EntityEntry e)

Implements org.hibernate.engine.spi.SessionImplementor.forceFlush.

Initiate a flush to force deletion of a re-persisted entity.
public void
forceFlush(EntityKey e)

Implements org.hibernate.engine.spi.SessionImplementor.forceFlush.

Initiate a flush to force deletion of a re-persisted entity.
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 <T> T
get(Class<T>
the entity type
theClass
,
Object
an identifier
id
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public <T> T
get(Class<T>
the entity type
theClass
,
Object
an identifier
id
,
LockMode
the lock mode
lockMode
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public <T> T
get(Class<T>
the entity type
theClass
,
Object
an identifier
id
,
LockOptions
the lock mode
lockOptions
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public Object
get(String
the entity name
entityName
,
Object
an identifier
id
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance.
public Object
get(String
the entity name
entityName
,
Object
an identifier
id
,
LockMode
the lock mode
lockMode
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public Object
get(String
the entity name
entityName
,
Object
an identifier
id
,
LockOptions
contains the lock mode
lockOptions
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public ActionQueue
public CacheMode
public CacheRetrieveMode
public CacheStoreMode
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 LockMode
getCurrentLockMode(Object
a persistent instance
object
)

Implements org.hibernate.Session.getCurrentLockMode.

Determine the current LockMode of the given managed instance associated with this session.
public Object
public Filter
getEnabledFilter(String
the name of the filter to be retrieved.
filterName
)

Implements org.hibernate.Session.getEnabledFilter.

Retrieve a currently enabled filter by name.
public RootGraphImplementor<?>
getEntityGraph(String
the name of the graph
graphName
)

Implements org.hibernate.engine.spi.SessionImplementor.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>
entity class
entityClass
)

Implements org.hibernate.Session.getEntityGraphs, org.hibernate.SharedSessionContract.getEntityGraphs.

Retrieve all named EntityGraphs with the given type.
public EntityManagerFactory
getEntityManagerFactory()

Implements jakarta.persistence.EntityManager.getEntityManagerFactory.

Return the entity manager factory for the entity manager.
public String
getEntityName(Object
a persistent entity associated with this session
object
)

Implements org.hibernate.Session.getEntityName.

Return the entity name for a persistent entity.
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.SharedSessionContract.getFactory, org.hibernate.engine.spi.SharedSessionContractImplementor.getFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Obtain the factory which created this session.
public int
getFetchBatchSize()

Implements org.hibernate.Session.getFetchBatchSize.

Get the maximum batch size for batch fetching associations by id in this session.
public FlushModeType
public FlushMode
public Object
getIdentifier(Object
a persistent instance associated with this session
object
)

Implements org.hibernate.Session.getIdentifier.

Return the identifier value of the given entity associated with this session.
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 LobHelper
public LockModeType
getLockMode(Object
entity instance
entity
)

Implements jakarta.persistence.EntityManager.getLockMode.

Get the current lock mode for the entity instance.
public Metamodel
getMetamodel()

Implements jakarta.persistence.EntityManager.getMetamodel.

Return an instance of Metamodel interface for access to the metamodel of the persistence unit.
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 Map<String, Object>
getProperties()

Implements jakarta.persistence.EntityManager.getProperties.

Get the properties and hints and associated values that are in effect for the entity manager.
public <T> T
getReference(Class<T>
the entity type
entityClass
,
Object
the identifier of a persistent instance that exists in the database
id
)

Implements org.hibernate.Session.getReference.

Return a reference to the persistent instance with the given class and identifier, making the assumption that the instance is still persistent in the database.
public Object
getReference(String
the entity name
entityName
,
Object
the identifier of a persistent instance that exists in the database
id
)

Implements org.hibernate.Session.getReference.

Return a reference to the persistent instance of the given named entity with the given identifier, making the assumption that the instance is still persistent in the database.
public <T> T
getReference(T
a detached persistent instance
object
)

Implements org.hibernate.Session.getReference.

Return a reference to the persistent instance with the same identity as the given instance, which might be detached, making the assumption that the instance is still persistent in the database.
public SessionImplementor
getSession()

Overrides default org.hibernate.engine.spi.SessionImplementor.getSession.

Returns this object, fulfilling the contract of WrapperOptions.
public SessionFactoryImplementor
getSessionFactory()

Implements org.hibernate.engine.spi.SessionImplementor.getSessionFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Get the session factory which created this session.
public UUID
public SessionStatistics
getStatistics()

Implements org.hibernate.Session.getStatistics.

Get the statistics for this session.
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
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.SessionImplementor.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.Session.isDefaultReadOnly, org.hibernate.engine.spi.SharedSessionContractImplementor.isDefaultReadOnly.

Will entities and proxies that are loaded into this session be made read-only by default?
public boolean
isDirty()

Implements org.hibernate.Session.isDirty.

Does this session contain any changes which must be synchronized with the database?
public boolean
public boolean
isFetchProfileEnabled(String
the name of the profile
name
)

Implements org.hibernate.Session.isFetchProfileEnabled.

Is the fetch profile with the given name enabled in this session?
public boolean
public boolean
public boolean
isOpenOrWaitingForAutoClose()

Overrides default org.hibernate.engine.spi.SharedSessionContractImplementor.isOpenOrWaitingForAutoClose.

Determines whether the session is open or is waiting for auto-close.
public boolean
isReadOnly(Object
an entity or proxy
entityOrProxy
)

Implements org.hibernate.Session.isReadOnly.

Is the specified entity or proxy read-only?
public boolean
isSubselectFetchingEnabled()

Implements org.hibernate.Session.isSubselectFetchingEnabled.

Determine if subselect fetching is enabled in this session.
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
public <T> T
load(Class<T>
a persistent class
theClass
,
Object
a valid identifier of an existing persistent instance of the class
id
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
public <T> T
load(Class<T>
a persistent class
theClass
,
Object
a valid identifier of an existing persistent instance of the class
id
,
LockOptions
contains the lock level
lockOptions
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
public Object
load(String
the entity name
entityName
,
Object
a valid identifier of an existing persistent instance of the class
id
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
public Object
load(String
the entity name
entityName
,
Object
a valid identifier of an existing persistent instance of the class
id
,
LockOptions
contains the lock level
lockOptions
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
public <T> T
load(Class<T>
a persistent class
theClass
,
Object
a valid identifier of an existing persistent instance of the class
id
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, making the assumption that the instance exists in the database.
public Object
load(String
the entity name
entityName
,
Object
a valid identifier of an existing persistent instance of the class
id
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, making the assumption that the instance exists in the database.
public void
load(Object object, Object id)

Implements org.hibernate.Session.load.

Read the persistent state associated with the given identifier into the given transient instance.
public void
lock(Object
entity instance
entity
,
LockModeType
lock mode
lockMode
)

Implements jakarta.persistence.EntityManager.lock.

Lock an entity instance that is contained in the persistence context with the specified lock mode type.
public void
lock(Object
entity instance
entity
,
LockModeType
lock mode
lockMode
,
Map<String, Object>
standard and vendor-specific properties and hints
properties
)

Implements jakarta.persistence.EntityManager.lock.

Lock an entity instance that is contained in the persistence context with the specified lock mode type and with specified properties.
public void
lock(Object
a persistent or transient instance
object
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.lock.

Obtain the specified lock level on the given managed instance associated with this session.
public void
lock(String
the name of the entity
entityName
,
Object
a persistent or transient instance
object
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.lock.

Obtain the specified lock level on the given managed instance associated with this session.
public void
lock(String entityName, Object object, LockOptions lockOptions)

Implements org.hibernate.engine.spi.SessionImplementor.lock.

Cascade the lock operation to the given child entity.
public void
lock(Object
a persistent or transient instance
object
,
LockOptions
the lock options
lockOptions
)

Implements org.hibernate.Session.lock.

Obtain a lock on the given managed instance associated with this session, using the given lock options.
public void
markForRollbackOnly()

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

Marks current transaction, if any, for rollback only.
public <T> T
merge(T
a detached instance with state to be copied
object
)

Implements org.hibernate.Session.merge.

Copy the state of the given object onto the persistent object with the same identifier.
public <T> T
merge(String
the entity name
entityName
,
T
a detached instance with state to be copied
object
)

Implements org.hibernate.Session.merge.

Copy the state of the given object onto the persistent object with the same identifier.
public void
public void
persist(Object
a transient instance to be made persistent
object
)

Implements org.hibernate.Session.persist.

Make a transient instance persistent and mark it for later insertion in the database.
public void
persist(String
the entity name
entityName
,
Object
a transient instance to be made persistent
object
)

Implements org.hibernate.Session.persist.

Make a transient instance persistent and mark it for later insertion in the database.
public void
public void
public void
private QueryProducerImplementor
public void
refresh(Object
a persistent or detached instance
object
)

Implements org.hibernate.Session.refresh.

Reread the state of the given managed instance associated with this session from the underlying database.
public void
refresh(Object
entity instance
entity
,
Map<String, Object>
standard and vendor-specific properties and hints
properties
)

Implements jakarta.persistence.EntityManager.refresh.

Refresh the state of the instance from the database, using the specified properties, and overwriting changes made to the entity, if any.
public void
refresh(Object
entity instance
entity
,
LockModeType
lock mode
lockMode
)

Implements jakarta.persistence.EntityManager.refresh.

Refresh the state of the instance from the database, overwriting changes made to the entity, if any, and lock it with respect to given lock mode type.
public void
refresh(Object
entity instance
entity
,
LockModeType
lock mode
lockMode
,
Map<String, Object>
standard and vendor-specific properties and hints
properties
)

Implements jakarta.persistence.EntityManager.refresh.

Refresh the state of the instance from the database, overwriting changes made to the entity, if any, and lock it with respect to given lock mode type and with specified properties.
public void
refresh(String
the name of the entity
entityName
,
Object
a persistent or detached instance
object
)

Implements org.hibernate.Session.refresh.

Reread the state of the given managed instance associated with this session from the underlying database.
public void
refresh(Object
a persistent or detached instance
object
,
LockMode
the lock mode to use
lockMode
)

Implements org.hibernate.Session.refresh.

Reread the state of the given managed instance from the underlying database, obtaining the given LockMode.
public void
refresh(Object
a persistent or detached instance
object
,
LockOptions
contains the lock mode to use
lockOptions
)

Implements org.hibernate.Session.refresh.

Reread the state of the given managed instance from the underlying database, obtaining the given LockMode.
public void
refresh(String
the name of the entity
entityName
,
Object
a persistent or detached instance
object
,
LockOptions
contains the lock mode to use
lockOptions
)

Implements org.hibernate.Session.refresh.

Reread the state of the given managed instance from the underlying database, obtaining the given LockMode.
public void
public void
remove(Object
the managed persistent instance to remove
entity
)

Implements org.hibernate.Session.remove.

Mark a persistence instance associated with this session for removal from the underlying database.
public void
public void
replicate(Object
a detached instance of a persistent class
object
,
ReplicationMode
the replication mode to use
replicationMode
)

Implements org.hibernate.Session.replicate.

Deprecated as a consequence of ReplicationMode being deprecated.
Persist the state of the given detached instance, reusing the current identifier value.
public void
replicate(String
the entity name
entityName
,
Object
a detached instance of a persistent class
object
,
ReplicationMode
the replication mode to use
replicationMode
)

Implements org.hibernate.Session.replicate.

Deprecated as a consequence of ReplicationMode being deprecated.
Persist the state of the given detached instance, reusing the current identifier value.
public Object
save(Object
a transient instance of a persistent class
object
)

Implements org.hibernate.Session.save.

Persist the given transient instance, first assigning a generated identifier.
public Object
save(String
the entity name
entityName
,
Object
a transient instance of a persistent class
object
)

Implements org.hibernate.Session.save.

Persist the given transient instance, first assigning a generated identifier.
public void
saveOrUpdate(Object
a transient or detached instance containing new or updated state
object
)

Implements org.hibernate.Session.saveOrUpdate.

Either save(Object) or update(Object) the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking).
public void
saveOrUpdate(String
the entity name
entityName
,
Object
a transient or detached instance containing new or updated state
object
)

Implements org.hibernate.Session.saveOrUpdate.

Either save(String, Object) or update(String, Object) the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking).
public SharedSessionBuilder
sessionWithOptions()

Implements org.hibernate.Session.sessionWithOptions.

Obtain a Session builder with the ability to copy certain information from this session.
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
setCacheRetrieveMode(CacheRetrieveMode
a JPA-defined CacheRetrieveMode
cacheRetrieveMode
)

Implements org.hibernate.Session.setCacheRetrieveMode.

Enable or disable reads from the second-level cache.
public void
setCacheStoreMode(CacheStoreMode
a JPA-defined CacheStoreMode
cacheStoreMode
)

Implements org.hibernate.Session.setCacheStoreMode.

Enable or disable writes to the second-level cache.
public void
public void
setDefaultReadOnly(boolean
true, the default for loaded entities/proxies is read-only; false, the default for loaded entities/proxies is modifiable
readOnly
)

Implements org.hibernate.Session.setDefaultReadOnly.

Change the default for entities and proxies loaded into this session from modifiable to read-only mode, or from modifiable to read-only mode.
public void
setFetchBatchSize(int
the maximum batch size for batch fetching
batchSize
)

Implements org.hibernate.Session.setFetchBatchSize.

Set the maximum batch size for batch fetching associations by id in this session.
public void
setFlushMode(FlushModeType flushModeType)

Implements org.hibernate.Session.setFlushMode.

Set the current JPA flush mode for this session.
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 void
setProperty(String
name of property or hint
propertyName
,
Object
value for property or hint
value
)

Implements jakarta.persistence.EntityManager.setProperty.

Set an entity manager property or hint.
public void
setReadOnly(Object
an entity or proxy
entityOrProxy
,
boolean
true if the entity or proxy should be made read-only; false if the entity or proxy should be made modifiable
readOnly
)

Implements org.hibernate.Session.setReadOnly.

Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode.
public void
setSubselectFetchingEnabled(boolean
true to enable subselect fetching
enabled
)

Implements org.hibernate.Session.setSubselectFetchingEnabled.

Enable or disable subselect fetching in this session.
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 <T> T
unwrap(Class<T>
the class of the object to be returned. This is normally either the underlying EntityManager implementation class or an interface that it implements.
cls
)

Implements jakarta.persistence.EntityManager.unwrap.

Return an object of the specified type to allow access to the provider-specific API.
public void
update(Object
a detached instance containing updated state
object
)

Implements org.hibernate.Session.update.

Update the persistent instance with the identifier of the given detached instance.
public void
update(String
the entity name
entityName
,
Object
a detached instance containing updated state
object
)

Implements org.hibernate.Session.update.

Update the persistent instance with the identifier of the given detached instance.
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