Top Description Inners Fields Constructors Methods
org.hibernate.internal

public Class SessionImpl

extends AbstractSharedSessionContract
implements Serializable, SharedSessionContractImplementor, JdbcSessionOwner, SessionImplementor, EventSource, Options, WrapperOptions, LoadAccessContext
Class Inheritance
All Implemented Interfaces
org.hibernate.loader.internal.LoadAccessContext, org.hibernate.type.descriptor.WrapperOptions, org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder.Options, org.hibernate.event.spi.EventSource, 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.engine.jdbc.LobCreationContext, org.hibernate.resource.jdbc.spi.JdbcSessionOwner, org.hibernate.SharedSessionContract, java.io.Serializable, java.io.Closeable, java.lang.AutoCloseable, org.hibernate.Session, jakarta.persistence.EntityManager
Imports
java.io.IOException, .InputStream, .ObjectInputStream, .ObjectOutputStream, .Reader, .Serializable, java.sql.Blob, .Clob, .Connection, .NClob, .SQLException, java.util.HashMap, .Map, .Set, org.hibernate.CacheMode, .ConnectionAcquisitionMode, .FetchNotFoundException, .Filter, .FlushMode, .HibernateException, .Interceptor, .JDBCException, .LobHelper, .LockMode, .LockOptions, .MappingException, .MultiIdentifierLoadAccess, .NaturalIdLoadAccess, .NaturalIdMultiLoadAccess, .ObjectDeletedException, .ObjectNotFoundException, .ReplicationMode, .Session, .SessionEventListener, .SessionException, .SharedSessionBuilder, .SimpleNaturalIdLoadAccess, .Transaction, .TransientObjectException, .TypeMismatchException, .UnknownProfileException, .UnresolvableObjectException, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.internal.StatefulPersistenceContext, org.hibernate.engine.jdbc.LobCreator, .NonContextualLobCreator, org.hibernate.engine.jdbc.spi.JdbcCoordinator, org.hibernate.engine.spi.ActionQueue, .EffectiveEntityGraph, .EntityEntry, .EntityKey, .LoadQueryInfluencers, .PersistenceContext, .SessionFactoryImplementor, .SessionImplementor, .SharedSessionContractImplementor, .Status, org.hibernate.engine.transaction.spi.TransactionImplementor, .TransactionObserver, org.hibernate.event.spi.EventManager, .HibernateMonitoringEvent, .AutoFlushEvent, .AutoFlushEventListener, .ClearEvent, .ClearEventListener, .DeleteContext, .DeleteEvent, .DeleteEventListener, .DirtyCheckEvent, .DirtyCheckEventListener, .EventSource, .EvictEvent, .EvictEventListener, .FlushEvent, .FlushEventListener, .InitializeCollectionEvent, .InitializeCollectionEventListener, .LoadEvent, .LoadEventListener, .LoadEventListener.LoadType, .LockEvent, .LockEventListener, .MergeContext, .MergeEvent, .MergeEventListener, .PersistContext, .PersistEvent, .PersistEventListener, .RefreshContext, .RefreshEvent, .RefreshEventListener, .ReplicateEvent, .ReplicateEventListener, .ResolveNaturalIdEvent, .ResolveNaturalIdEventListener, .SaveOrUpdateEvent, .SaveOrUpdateEventListener, org.hibernate.graph.GraphSemantic, org.hibernate.graph.spi.RootGraphImplementor, org.hibernate.internal.util.ExceptionHelper, org.hibernate.jpa.internal.LegacySpecHelper, org.hibernate.jpa.internal.util.ConfigurationHelper, .FlushModeTypeHelper, .LockModeTypeHelper, org.hibernate.loader.internal.IdentifierLoadAccessImpl, .LoadAccessContext, .NaturalIdLoadAccessImpl, .SimpleNaturalIdLoadAccessImpl, org.hibernate.persister.entity.EntityPersister, org.hibernate.pretty.MessageHelper, org.hibernate.procedure.ProcedureCall, org.hibernate.procedure.spi.NamedCallableQueryMemento, org.hibernate.proxy.LazyInitializer, org.hibernate.query.Query, .SelectionQuery, .UnknownSqlResultSetMappingException, org.hibernate.resource.jdbc.spi.JdbcSessionOwner, .PhysicalConnectionHandlingMode, org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl, org.hibernate.resource.transaction.spi.TransactionCoordinator, .TransactionCoordinatorBuilder, .TransactionStatus, org.hibernate.stat.SessionStatistics, org.hibernate.stat.internal.SessionStatisticsImpl, org.hibernate.stat.spi.StatisticsImplementor, org.hibernate.type.descriptor.WrapperOptions, jakarta.persistence.CacheRetrieveMode, .CacheStoreMode, .EntityManager, .EntityNotFoundException, .FlushModeType, .LockModeType, .PersistenceException, .TransactionRequiredException, jakarta.persistence.metamodel.Metamodel

Concrete implementation of the Session API.

Exposes two interfaces:

This class is not thread-safe.

Authors
Gavin King, Steve Ebersole, Brett Meyer, Chris Cranford, Sanne Grinovero

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class
private static class

Field Summary

Modifier and TypeField and Description
private transient ActionQueue
private boolean
private final boolean
private transient boolean
private transient LoadEvent
private transient LoadQueryInfluencers
private transient SessionImpl.LobHelperImpl
private LockOptions
private static final EntityManagerMessageLogger
private transient StatefulPersistenceContext
private Map<String, Object>
private transient TransactionObserver
transactionObserver

Deprecated as a consequence of TransactionObserver being deprecated.
Inherited from org.hibernate.internal.AbstractSharedSessionContract:
closedfastSessionServiceswaitingForAutoClose

Constructor Summary

AccessConstructor and Description
public
SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options)

Deprecated as a consequence of SessionFactoryImpl being deprecated.

Method Summary

Modifier and TypeMethod and Description
public void
addEventListeners(SessionEventListener...
the listener(s) to add
listeners
)

Implements org.hibernate.Session.addEventListeners.

Add one or more listeners to the Session
protected void
public void
afterOperation(boolean
true if the operation a success
success
)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.afterOperation, org.hibernate.loader.internal.LoadAccessContext.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
)

Overrides org.hibernate.internal.AbstractSharedSessionContract.afterTransactionCompletion.

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

An after-completion callback to the owner.
protected void
protected void
protected void
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 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 String
bestGuessEntityName(Object object, EntityEntry entry)

Overrides default 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.
private LockOptions
buildLockOptions(LockModeType lockModeType, Map<String, Object> properties)

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> IdentifierLoadAccessImpl<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> IdentifierLoadAccessImpl<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.
protected void
protected void
public void
protected void
private void
private void
protected void
cleanupOnClose()

Overrides org.hibernate.internal.AbstractSharedSessionContract.cleanupOnClose.

clear all the internal collections, just to help the garbage collector, does not clear anything that is needed during the afterTransactionCompletion() phase
public void
clear()

Implements org.hibernate.Session.clear.

Completely clear the session.
public void
public void
private Map<String, Object>
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 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.
protected ActionQueue
private ClearEvent
public ProcedureCall
protected StatefulPersistenceContext
public ProcedureCall
public ProcedureCall
createStoredProcedureCall(String
The name of the procedure.
procedureName
,
String...
The explicit result set mapping(s) to use for mapping the results
resultSetMappings
)

Overrides org.hibernate.internal.AbstractSharedSessionContract.createStoredProcedureCall.

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
,
Class<?>...
The entity(s) to map the result on to.
resultClasses
)

Overrides org.hibernate.internal.AbstractSharedSessionContract.createStoredProcedureCall.

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
)

Overrides org.hibernate.internal.AbstractSharedSessionContract.createStoredProcedureQuery.

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
)

Overrides org.hibernate.internal.AbstractSharedSessionContract.createStoredProcedureQuery.

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

Create a ProcedureCall to a stored procedure with the given result set entity mappings.
public void
public void
delete(Object
the instance to be removed
object
)

Implements org.hibernate.Session.delete.

Deprecated
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.

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

Implements org.hibernate.engine.spi.SessionImplementor.delete, org.hibernate.event.spi.EventSource.delete.

Cascade delete an entity instance
public void
detach(Object
the managed instance to detach
entity
)

Implements org.hibernate.Session.detach.

Remove this instance from the session cache.
protected CacheMode
private static CacheRetrieveMode
private static CacheStoreMode
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.
private void
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 any hard references to the entity that are held by the infrastructure (references held by application or other persistent instances are okay)
public <T> T
find(Class<T>
entity class
entityClass
,
Object
primary key
primaryKey
)

Implements jakarta.persistence.EntityManager.find.

Find by primary key.
public <T> 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> T
find(Class<T>
entity class
entityClass
,
Object
primary key
primaryKey
,
LockModeType
lock mode
lockModeType
)

Implements jakarta.persistence.EntityManager.find.

Find by primary key and lock.
public <T> T
find(Class<T>
entity class
entityClass
,
Object
primary key
primaryKey
,
LockModeType
lock mode
lockModeType
,
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.
private void
private void
fireDelete(final DeleteEvent event)

private void
fireDelete(final DeleteEvent event, final DeleteContext transientEntities)

public void
private void
private void
fireLock(String entityName, Object object, LockOptions options)

private void
fireLock(Object object, LockOptions options)

private void
private Object
private void
fireMerge(final MergeContext mergeContext, final MergeEvent event)

private void
private void
firePersist(final PersistContext copiedAlready, final PersistEvent event)

private void
private void
fireRefresh(final RefreshContext refreshedAlready, final RefreshEvent event)

private void
private void
private Object
private void
private void
public void
public void
public void
forceFlush(EntityEntry entityEntry)

Implements org.hibernate.engine.spi.SessionImplementor.forceFlush, org.hibernate.event.spi.EventSource.forceFlush.

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

Implements org.hibernate.engine.spi.SessionImplementor.forceFlush, org.hibernate.event.spi.EventSource.forceFlush.

Initiate a flush to force deletion of a re-persisted entity.
public <T> T
get(Class<T>
the entity type
entityClass
,
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 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 <T> T
get(Class<T>
the entity type
entityClass
,
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
entityClass
,
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
,
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 CacheRetrieveMode
public CacheStoreMode
public Object
getContextEntityIdentifier(Object object)

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

Get the id value for an object that is actually associated with the session.
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
getDelegate()

Implements jakarta.persistence.EntityManager.getDelegate.

Return the underlying provider object for the EntityManager, if available.
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 SessionFactoryImplementor
getEntityManagerFactory()

Implements jakarta.persistence.EntityManager.getEntityManagerFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
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
getEntityPersister(final String entityName, final Object object)

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 int
getFetchBatchSize()

Implements org.hibernate.Session.getFetchBatchSize.

Get the maximum batch size for batch fetching associations by id in this session.
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.
private FlushMode
public LoadQueryInfluencers
public LobHelper
public LockModeType
getLockMode(Object
entity instance
entity
)

Implements jakarta.persistence.EntityManager.getLockMode.

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

Implements jakarta.persistence.EntityManager.getMetamodel.

Return an instance of Metamodel interface for access to the metamodel of the persistence unit.
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 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.
private Boolean
private static Boolean
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 <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 SessionImplementor
public SessionFactoryImplementor
private Object
public SessionStatistics
getStatistics()

Implements org.hibernate.Session.getStatistics.

Get the statistics for this session.
private Transaction
public String
guessEntityName(Object object)

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
immediateLoad(String entityName, Object id)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.immediateLoad.

Load the data for the object with the specified id into a newly created 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
private void
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.
protected static LoadEventListener.LoadType
internalLoadType(boolean eager, boolean nullable)

private void
interpretProperty(String propertyName, Object value)

public boolean
public boolean
public boolean
isDirty()

Implements org.hibernate.Session.isDirty.

Does this session contain any changes which must be synchronized with the database?
public boolean
isEnforcingFetchGraph()

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

Deprecated for removal.
Are we currently enforcing a fetch graph?
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
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.
private boolean
private boolean
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 <T> T
load(Class<T>
a persistent class
entityClass
,
Object
a valid identifier of an existing persistent instance of the class
id
)

Implements org.hibernate.Session.load.

Deprecated
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 abstract org.hibernate.internal.AbstractSharedSessionContract.load.

Implements org.hibernate.Session.load.

Deprecated
Return the persistent instance of the given entity class with the given identifier, making the assumption that the instance exists in the database.
public <T> T
load(Class<T>
a persistent class
entityClass
,
Object
a valid identifier of an existing persistent instance of the class
id
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.load.

Deprecated
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
entityClass
,
Object
a valid identifier of an existing persistent instance of the class
id
,
LockOptions
contains the lock level
lockOptions
)

Implements org.hibernate.Session.load.

Deprecated
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.

Deprecated
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.

Deprecated
Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
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
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(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(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(Object
entity instance
entity
,
LockModeType
lock mode
lockModeType
)

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
lockModeType
,
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.
private void
logRemoveOrphanBeforeUpdates(String timing, String entityName, Object entity)

private void
private void
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 <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 void
merge(String entityName, Object object, MergeContext copiedAlready)

Implements org.hibernate.engine.spi.SessionImplementor.merge, org.hibernate.event.spi.EventSource.merge.

Cascade merge an entity instance
private boolean
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
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 entityName, Object object, PersistContext copiedAlready)

Implements org.hibernate.engine.spi.SessionImplementor.persist, org.hibernate.event.spi.EventSource.persist.

Cascade persist an entity instance
public void
persistOnFlush(String entityName, Object object, PersistContext copiedAlready)

Implements org.hibernate.engine.spi.SessionImplementor.persistOnFlush, org.hibernate.event.spi.EventSource.persistOnFlush.

Cascade persist an entity instance during the flush process
public void
private void
readObject(ObjectInputStream
The input stream from which we are being read...
ois
)

Hides org.hibernate.internal.AbstractSharedSessionContract.readObject.

Used by JDK serialization...
private LoadEvent
recycleEventInstance(final LoadEvent event, final Object id, final String entityName)

Helper to avoid creating many new instances of LoadEvent: it's an allocation hot spot.

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(String
the name of the entity
entityName
,
Object
a persistent or detached instance
object
)

Implements org.hibernate.Session.refresh.

Deprecated
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.

Deprecated
Reread the state of the given managed instance from the underlying database, obtaining the given LockMode.
public void
refresh(String entityName, Object object, RefreshContext refreshedAlready)

Implements org.hibernate.engine.spi.SessionImplementor.refresh, org.hibernate.event.spi.EventSource.refresh.

Cascade refresh an entity instance
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
lockModeType
)

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
lockModeType
,
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
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
removeOrphanBeforeUpdates(String entityName, Object child)

Implements org.hibernate.engine.spi.SessionImplementor.removeOrphanBeforeUpdates, org.hibernate.event.spi.EventSource.removeOrphanBeforeUpdates.

A specialized type of deletion for orphan removal that must occur prior to queued inserts and updates.
protected void
public void
replicate(Object
a detached instance of a persistent class
obj
,
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
obj
,
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.
private EntityPersister
requireEntityPersister(Class<?> entityClass)

private EntityPersister
public Object
save(Object
a transient instance of a persistent class
obj
)

Implements org.hibernate.Session.save.

Deprecated
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.

Deprecated
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.

Deprecated
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
obj
)

Implements org.hibernate.Session.saveOrUpdate.

Deprecated
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
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
setDefaultReadOnly(boolean
true, the default for loaded entities/proxies is read-only; false, the default for loaded entities/proxies is modifiable
defaultReadOnly
)

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
setEnforcingFetchGraph(boolean isEnforcingFetchGraph)

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

Deprecated for removal.
Enable or disable fetch graph enforcement.
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
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
entity
,
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?
protected boolean
public void
startTransactionBoundary()

Overrides org.hibernate.internal.AbstractSharedSessionContract.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
private void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
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.
clazz
)

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
obj
)

Implements org.hibernate.Session.update.

Deprecated
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.

Deprecated
Update the persistent instance with the identifier of the given detached instance.
private void
writeObject(ObjectOutputStream
The output stream to which we are being written...
oos
)

Hides org.hibernate.internal.AbstractSharedSessionContract.writeObject.

Used by JDK serialization...
Inherited from org.hibernate.internal.AbstractSharedSessionContract:
accessTransactionaddResultTypebeginTransactionbuildNamedQuerybuildNamedQuerycheckMutationQuerycheckOpencheckResultTypecheckSelectionQuerycheckTransactionNeededForUpdateOperationcheckTransactionSynchStatuscreateEntityGraphcreateEntityGraphcreateEntityGraphcreateMutationQuerycreateMutationQuerycreateMutationQuerycreateMutationQuerycreateNamedMutationQuerycreateNamedQuerycreateNamedQuerycreateNamedSelectionQuerycreateNamedSelectionQuerycreateNativeMutationQuerycreateNativeQuerycreateNativeQuerycreateNativeQuerycreateNativeQuerycreateNativeQuerycreateNativeQueryImplementorcreateNativeQueryImplementorcreateQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateSelectionQuerycreateSelectionQuerycreateSelectionQuerycreateSqmQueryImplementorcreateSqmQueryImplementordoReturningWorkdoWorkexecutegenerateEntityKeygetCacheModegetCacheTransactionSynchronizationgetConfiguredJdbcBatchSizegetCriteriaBuildergetCurrentTransactiongetEntityGraphgetEntityGraphsgetEntityNameResolvergetEventListenerManagergetEventManagergetExceptionConvertergetFactorygetFlushModegetHibernateFlushModegetInterceptorgetJdbcBatchSizegetJdbcConnectionAccessgetJdbcCoordinatorgetJdbcServicesgetJdbcSessionContextgetJdbcTimeZonegetLobCreatorgetNamedNativeQuerygetNamedNativeQuerygetNamedProcedureCallgetNamedQuerygetNativeJdbcParametersIgnoredgetPreferredSqlTypeCodeForBooleangetResultSetMappingMementogetSessionIdentifiergetSessionTokengetTenantIdentifiergetTenantIdentifierValuegetTransactiongetTransactionCoordinatorinterpretHqlisClosedisConnectedisCriteriaCopyTreeEnabledisJoinedToTransactionisOpenOrWaitingForAutoCloseisTransactionInProgressjoinTransactionmarkForRollbackOnlyprepareForAutoCloseprepareForQueryExecutionsetCacheModesetClosedsetCriteriaCopyTreeEnabledsetHibernateFlushModesetJdbcBatchSizesetNativeJdbcParametersIgnoredsetUpMultitenancyshouldAutoJoinTransactionuseStreamForLobBinding