Top Description Methods
org.hibernate.engine.spi

public Interface SessionImplementor

extends Session, SharedSessionContractImplementor
Known Direct Subinterfaces
org.hibernate.event.spi.EventSource
Known Direct Implementers
org.hibernate.internal.SessionImpl, org.hibernate.engine.spi.SessionDelegatorBaseImpl
Imports
org.hibernate.HibernateException, .LockOptions, .Session, org.hibernate.engine.jdbc.LobCreationContext, org.hibernate.engine.jdbc.spi.JdbcCoordinator, org.hibernate.event.spi.DeleteContext, .MergeContext, .PersistContext, .RefreshContext, org.hibernate.graph.spi.RootGraphImplementor, org.hibernate.persister.entity.EntityPersister, org.hibernate.resource.jdbc.spi.JdbcSessionOwner, org.hibernate.resource.transaction.spi.TransactionCoordinator, .TransactionCoordinatorBuilder, org.hibernate.type.descriptor.WrapperOptions

Defines the "internal contract" between Session and other parts of Hibernate including implementors of org.hibernate.type.Type, EntityPersister, and org.hibernate.persister.collection.CollectionPersister.

The Session, via this interface and SharedSessionContractImplementor, implements:

See also org.hibernate.event.spi.EventSource which extends this interface provides a bridge to the event generation features of org.hibernate.event.
Authors
Gavin King, Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public default SessionImplementor
public <T> RootGraphImplementor<T>
createEntityGraph(Class<T>
the root entity class of the graph
rootType
)

Redeclares org.hibernate.Session.createEntityGraph, org.hibernate.SharedSessionContract.createEntityGraph.

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

Redeclares org.hibernate.Session.createEntityGraph, 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 void
delete(String entityName, Object child, boolean isCascadeDeleteEnabled, DeleteContext transientEntities)

Deprecated OperationalContext should cover this overload I believe
public void
forceFlush(EntityEntry e)

Initiate a flush to force deletion of a re-persisted entity.

public void
forceFlush(EntityKey e)

Initiate a flush to force deletion of a re-persisted entity.

public ActionQueue
getActionQueue()

Get the ActionQueue associated with this session.

public RootGraphImplementor<?>
getEntityGraph(String
the name of the graph
graphName
)

Redeclares org.hibernate.Session.getEntityGraph, org.hibernate.SharedSessionContract.getEntityGraph.

Retrieve the named EntityGraph as an immutable graph, or return null if there is no graph with the given name.
public default SessionImplementor
getSession()

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

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

Redeclares org.hibernate.Session.getSessionFactory.

Redeclares as abstract: org.hibernate.engine.spi.SharedSessionContractImplementor.getSessionFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Get the session factory which created this session.
public Object
instantiate(EntityPersister persister, Object id)

Redeclares org.hibernate.engine.spi.SharedSessionContractImplementor.instantiate.

Instantiate the entity class of the given EntityPersister, initializing the new instance with the given identifier.
public default boolean
public void
lock(String entityName, Object child, LockOptions lockOptions)

Cascade the lock operation to the given child entity.

public void
merge(String entityName, Object object, MergeContext copiedAlready)

Deprecated OperationalContext should cover this overload I believe
public void
persist(String entityName, Object object, PersistContext createdAlready)

Deprecated OperationalContext should cover this overload I believe
public void
persistOnFlush(String entityName, Object object, PersistContext copiedAlready)

Deprecated OperationalContext should cover this overload I believe
public void
refresh(String entityName, Object object, RefreshContext refreshedAlready)

Deprecated OperationalContext should cover this overload I believe
public void
removeOrphanBeforeUpdates(String entityName, Object child)

Deprecated OperationalContext should cover this overload I believe
Inherited from org.hibernate.engine.spi.SharedSessionContractImplementor:
accessTransactionafterOperationafterScrollOperationasEventSourceasStatelessSessionautoFlushIfRequiredbestGuessEntityNamebestGuessEntityNamecheckOpencheckOpencheckTransactionNeededForUpdateOperationflushgenerateEntityKeygetCacheModegetCacheTransactionSynchronizationgetConfiguredJdbcBatchSizegetContextEntityIdentifiergetEntityPersistergetEntityUsingInterceptorgetEventListenerManagergetExceptionConvertergetFactorygetFlushModegetHibernateFlushModegetInterceptorgetJdbcCoordinatorgetJdbcServicesgetLoadQueryInfluencersgetNativeJdbcParametersIgnoredgetPersistenceContextgetPersistenceContextInternalgetSessionIdentifiergetSessionTokengetTypeConfigurationguessEntityNameimmediateLoadinitializeCollectioninstantiateinternalLoadisAutoCloseSessionEnabledisClosedisCriteriaCopyTreeEnabledisDefaultReadOnlyisEnforcingFetchGraphisEventSourceisOpenOrWaitingForAutoCloseisStatelessSessionisTransactionInProgressmarkForRollbackOnlyprepareForQueryExecutionsetAutoClearsetCacheModesetCriteriaCopyTreeEnabledsetEnforcingFetchGraphsetHibernateFlushModesetNativeJdbcParametersIgnoredshouldAutoClose
Inherited from org.hibernate.Session:
addEventListenersbuildLockRequestbyIdbyIdbyMultipleIdsbyMultipleIdsbyMultipleNaturalIdbyMultipleNaturalIdbyNaturalIdbyNaturalIdbySimpleNaturalIdbySimpleNaturalIdcancelQueryclearcontainscreateNamedQuerycreateNamedQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateQuerydeletedeletedetachdisableFetchProfiledisableFilterenableFetchProfileenableFilterevictflushgetgetgetgetgetgetgetCacheModegetCacheRetrieveModegetCacheStoreModegetCurrentLockModegetEnabledFiltergetEntityGraphsgetEntityNamegetFetchBatchSizegetFlushModegetHibernateFlushModegetIdentifiergetLobHelpergetReferencegetReferencegetReferencegetStatisticsisDefaultReadOnlyisDirtyisFetchProfileEnabledisReadOnlyisSubselectFetchingEnabledloadloadloadloadloadloadloadlocklocklockmergemergepersistpersistrefreshrefreshrefreshrefreshrefreshremovereplicatereplicatesavesavesaveOrUpdatesaveOrUpdatesessionWithOptionssetCacheModesetCacheRetrieveModesetCacheStoreModesetDefaultReadOnlysetFetchBatchSizesetFlushModesetHibernateFlushModesetReadOnlysetSubselectFetchingEnabledupdateupdate

Method Detail

asSessionImplementorback to summary
public default SessionImplementor asSessionImplementor()

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

Doc from org.hibernate.engine.spi.SharedSessionContractImplementor.asSessionImplementor.

Cast this object to SessionImplementor, if possible.

Annotations
@Override
createEntityGraphback to summary
public <T> RootGraphImplementor<T> createEntityGraph(Class<T> rootType)

Redeclares org.hibernate.Session.createEntityGraph, org.hibernate.SharedSessionContract.createEntityGraph.

Doc from org.hibernate.SharedSessionContract.createEntityGraph.

Create a new mutable EntityGraph with only a root node.

Parameters
rootType:Class<T>

the root entity class of the graph

Returns:RootGraphImplementor<T>

Doc from jakarta.persistence.EntityManager.createEntityGraph.

entity graph

Annotations
@Override
createEntityGraphback to summary
public RootGraphImplementor<?> createEntityGraph(String graphName)

Redeclares org.hibernate.Session.createEntityGraph, org.hibernate.SharedSessionContract.createEntityGraph.

Doc from 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.

Parameters
graphName:String

the name of the graph

Returns:RootGraphImplementor<?>

Doc from jakarta.persistence.EntityManager.createEntityGraph.

entity graph

Annotations
@Override
deleteback to summary
public void delete(String entityName, Object child, boolean isCascadeDeleteEnabled, DeleteContext transientEntities)

Deprecated

OperationalContext should cover this overload I believe

Annotations
@Deprecated
forceFlushback to summary
public void forceFlush(EntityEntry e) throws HibernateException

Initiate a flush to force deletion of a re-persisted entity.

forceFlushback to summary
public void forceFlush(EntityKey e) throws HibernateException

Initiate a flush to force deletion of a re-persisted entity.

getActionQueueback to summary
public ActionQueue getActionQueue()

Get the ActionQueue associated with this session.

getEntityGraphback to summary
public RootGraphImplementor<?> getEntityGraph(String graphName)

Redeclares org.hibernate.Session.getEntityGraph, org.hibernate.SharedSessionContract.getEntityGraph.

Doc from org.hibernate.SharedSessionContract.getEntityGraph.

Retrieve the named EntityGraph as an immutable graph, or return null if there is no graph with the given name.

Parameters
graphName:String

the name of the graph

Returns:RootGraphImplementor<?>

Doc from jakarta.persistence.EntityManager.getEntityGraph.

named entity graph

Annotations
@Override
getSessionback to summary
public default SessionImplementor getSession()

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

Doc from org.hibernate.engine.spi.SharedSessionContractImplementor.getSession.

Returns this object, fulfilling the contract of WrapperOptions.

Annotations
@Override
getSessionFactoryback to summary
public SessionFactoryImplementor getSessionFactory()

Redeclares org.hibernate.Session.getSessionFactory.

Redeclares as abstract: org.hibernate.engine.spi.SharedSessionContractImplementor.getSessionFactory.

Doc from org.hibernate.Session.getSessionFactory.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Get the session factory which created this session.

Returns:SessionFactoryImplementor

the session factory

Annotations
@Override
instantiateback to summary
public Object instantiate(EntityPersister persister, Object id) throws HibernateException

Redeclares org.hibernate.engine.spi.SharedSessionContractImplementor.instantiate.

Doc from org.hibernate.engine.spi.SharedSessionContractImplementor.instantiate.

Instantiate the entity class of the given EntityPersister, initializing the new instance with the given identifier.

This is more efficient than instantiate(String, Object), but not always interchangeable, since a single persister might be responsible for multiple types.

isSessionImplementorback to summary
public default boolean isSessionImplementor()

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

Doc from org.hibernate.engine.spi.SharedSessionContractImplementor.isSessionImplementor.

Does this object implement SessionImplementor?

Annotations
@Override
lockback to summary
public void lock(String entityName, Object child, LockOptions lockOptions)

Cascade the lock operation to the given child entity.

mergeback to summary
public void merge(String entityName, Object object, MergeContext copiedAlready) throws HibernateException

Deprecated

OperationalContext should cover this overload I believe

Annotations
@Deprecated
persistback to summary
public void persist(String entityName, Object object, PersistContext createdAlready) throws HibernateException

Deprecated

OperationalContext should cover this overload I believe

Annotations
@Deprecated
persistOnFlushback to summary
public void persistOnFlush(String entityName, Object object, PersistContext copiedAlready)

Deprecated

OperationalContext should cover this overload I believe

Annotations
@Deprecated
refreshback to summary
public void refresh(String entityName, Object object, RefreshContext refreshedAlready) throws HibernateException

Deprecated

OperationalContext should cover this overload I believe

Annotations
@Deprecated
removeOrphanBeforeUpdatesback to summary
public void removeOrphanBeforeUpdates(String entityName, Object child)

Deprecated

OperationalContext should cover this overload I believe

Annotations
@Deprecated