Package org.hibernate.engine.spi
Interface SessionImplementor
-
- All Superinterfaces:
AutoCloseable
,Closeable
,jakarta.persistence.EntityManager
,JavaType.CoercionContext
,JdbcSessionOwner
,LobCreationContext
,QueryProducer
,QueryProducerImplementor
,Serializable
,Session
,SharedSessionContract
,SharedSessionContractImplementor
,TransactionCoordinatorBuilder.Options
,WrapperOptions
- All Known Subinterfaces:
EventSource
- All Known Implementing Classes:
AbstractDelegateSessionImplementor
,SessionDelegatorBaseImpl
,SessionImpl
,ToOneDelegateSessionImplementor
public interface SessionImplementor extends Session, SharedSessionContractImplementor
Defines the "internal contract" forSession
and other parts of Hibernate such asType
,EntityPersister
andCollectionPersister
implementations. A Session, through this interface and SharedSessionContractImplementor, implements:-
JdbcSessionOwner
to drive the behavior of theJdbcSessionContext
delegate -
TransactionCoordinatorBuilder.Options
to drive the creation of theTransactionCoordinator
delegate -
LobCreationContext
to act as the context for JDBC LOB instance creation -
WrapperOptions
to fulfill the behavior needed while binding/extracting values to/from JDBC as part of theType
contracts
EventSource
which extends this interface providing s bridge to the event generation features oforg.hibernate.event
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext
LobCreationContext.Callback<T>
-
Nested classes/interfaces inherited from interface org.hibernate.Session
Session.LockRequest
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default SessionImplementor
asSessionImplementor()
If this can be casted to a @SessionImplementor
, you'll get this returned after an efficient cast.<T> RootGraphImplementor<T>
createEntityGraph(Class<T> rootType)
RootGraphImplementor<?>
createEntityGraph(String graphName)
void
delete(String entityName, Object child, boolean isCascadeDeleteEnabled, DeleteContext transientEntities)
Deprecated.OperationalContext should cover this overload I believevoid
forceFlush(EntityEntry e)
ActionQueue
getActionQueue()
RootGraphImplementor<?>
getEntityGraph(String graphName)
default SessionImplementor
getSession()
Access to the current session.SessionFactoryImplementor
getSessionFactory()
Get the session factory which created this session.Object
instantiate(EntityPersister persister, Object id)
Instantiate the entity class of an EntityPersister, initializing with the given identifier.default boolean
isSessionImplementor()
void
lock(String entityName, Object child, LockOptions lockOptions)
void
merge(String entityName, Object object, MergeContext copiedAlready)
Deprecated.OperationalContext should cover this overload I believevoid
persist(String entityName, Object object, PersistContext createdAlready)
Deprecated.OperationalContext should cover this overload I believevoid
persistOnFlush(String entityName, Object object, PersistContext copiedAlready)
Deprecated.OperationalContext should cover this overload I believevoid
refresh(String entityName, Object object, RefreshContext refreshedAlready)
Deprecated.OperationalContext should cover this overload I believevoid
removeOrphanBeforeUpdates(String entityName, Object child)
Deprecated.OperationalContext should cover this overload I believe-
Methods inherited from interface jakarta.persistence.EntityManager
close, contains, createNamedStoredProcedureQuery, createNativeQuery, createNativeQuery, createNativeQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, find, find, find, find, getCriteriaBuilder, getDelegate, getEntityManagerFactory, getLockMode, getMetamodel, getProperties, getTransaction, isJoinedToTransaction, isOpen, joinTransaction, lock, lock, refresh, refresh, refresh, setProperty, unwrap
-
Methods inherited from interface org.hibernate.resource.jdbc.spi.JdbcSessionOwner
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, flushBeforeTransactionCompletion, getJdbcBatchSize, getJdbcConnectionAccess, getJdbcSessionContext, getTransactionCoordinator, startTransactionBoundary
-
Methods inherited from interface org.hibernate.engine.jdbc.LobCreationContext
execute
-
Methods inherited from interface org.hibernate.query.QueryProducer
createMutationQuery, createNamedSelectionQuery, createNamedSelectionQuery, createSelectionQuery, createSelectionQuery, createSelectionQuery
-
Methods inherited from interface org.hibernate.query.spi.QueryProducerImplementor
createMutationQuery, createMutationQuery, createMutationQuery, createNamedMutationQuery, createNamedQuery, createNamedQuery, createNativeMutationQuery, createNativeQuery, createNativeQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, getNamedNativeQuery, getNamedNativeQuery, getNamedQuery
-
Methods inherited from interface org.hibernate.Session
addEventListeners, buildLockRequest, byId, byId, byMultipleIds, byMultipleIds, byMultipleNaturalId, byMultipleNaturalId, byNaturalId, byNaturalId, bySimpleNaturalId, bySimpleNaturalId, cancelQuery, clear, contains, createNamedQuery, createNamedQuery, createQuery, createQuery, createQuery, createQuery, createQuery, delete, delete, detach, disableFetchProfile, disableFilter, enableFetchProfile, enableFilter, evict, flush, get, get, get, get, get, get, getCacheMode, getCacheRetrieveMode, getCacheStoreMode, getCurrentLockMode, getEnabledFilter, getEntityGraphs, getEntityName, getFlushMode, getHibernateFlushMode, getIdentifier, getLobHelper, getReference, getReference, getReference, getStatistics, isDefaultReadOnly, isDirty, isFetchProfileEnabled, isReadOnly, load, load, load, load, load, load, load, lock, lock, lock, merge, merge, persist, persist, refresh, refresh, refresh, refresh, refresh, remove, replicate, replicate, save, save, saveOrUpdate, saveOrUpdate, sessionWithOptions, setCacheMode, setCacheRetrieveMode, setCacheStoreMode, setDefaultReadOnly, setFlushMode, setHibernateFlushMode, setReadOnly, update, update
-
Methods inherited from interface org.hibernate.SharedSessionContract
beginTransaction, close, createNamedStoredProcedureQuery, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, doReturningWork, doWork, getCriteriaBuilder, getJdbcBatchSize, getNamedProcedureCall, getTransaction, isConnected, isOpen, setJdbcBatchSize
-
Methods inherited from interface org.hibernate.engine.spi.SharedSessionContractImplementor
accessTransaction, afterOperation, afterScrollOperation, asEventSource, asStatelessSession, autoFlushIfRequired, bestGuessEntityName, checkOpen, checkOpen, checkTransactionNeededForUpdateOperation, flush, generateEntityKey, getCacheMode, getCacheTransactionSynchronization, getConfiguredJdbcBatchSize, getContextEntityIdentifier, getEntityPersister, getEntityUsingInterceptor, getEventListenerManager, getExceptionConverter, getFactory, getFlushMode, getHibernateFlushMode, getInterceptor, getJdbcCoordinator, getJdbcServices, getLoadQueryInfluencers, getPersistenceContext, getPersistenceContextInternal, getSessionIdentifier, getSessionToken, getTenantIdentifier, getTypeConfiguration, guessEntityName, immediateLoad, initializeCollection, instantiate, internalLoad, isAutoCloseSessionEnabled, isClosed, isCriteriaCopyTreeEnabled, isDefaultReadOnly, isEnforcingFetchGraph, isEventSource, isOpenOrWaitingForAutoClose, isStatelessSession, isTransactionInProgress, markForRollbackOnly, prepareForQueryExecution, setAutoClear, setCacheMode, setCriteriaCopyTreeEnabled, setEnforcingFetchGraph, setHibernateFlushMode, shouldAutoClose
-
Methods inherited from interface org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder.Options
shouldAutoJoinTransaction
-
Methods inherited from interface org.hibernate.type.descriptor.WrapperOptions
getJdbcTimeZone, getLobCreator, getPreferredSqlTypeCodeForBoolean, useStreamForLobBinding
-
-
-
-
Method Detail
-
getSession
default SessionImplementor getSession()
Description copied from interface:WrapperOptions
Access to the current session.- Specified by:
getSession
in interfaceSharedSessionContractImplementor
- Specified by:
getSession
in interfaceWrapperOptions
-
getSessionFactory
SessionFactoryImplementor getSessionFactory()
Description copied from interface:Session
Get the session factory which created this session.- Specified by:
getSessionFactory
in interfaceSession
- Specified by:
getSessionFactory
in interfaceSharedSessionContractImplementor
- Specified by:
getSessionFactory
in interfaceWrapperOptions
- Returns:
- the session factory
- See Also:
SessionFactory
-
createEntityGraph
<T> RootGraphImplementor<T> createEntityGraph(Class<T> rootType)
- Specified by:
createEntityGraph
in interfacejakarta.persistence.EntityManager
- Specified by:
createEntityGraph
in interfaceSession
-
createEntityGraph
RootGraphImplementor<?> createEntityGraph(String graphName)
- Specified by:
createEntityGraph
in interfacejakarta.persistence.EntityManager
- Specified by:
createEntityGraph
in interfaceSession
-
getEntityGraph
RootGraphImplementor<?> getEntityGraph(String graphName)
- Specified by:
getEntityGraph
in interfacejakarta.persistence.EntityManager
- Specified by:
getEntityGraph
in interfaceSession
-
getActionQueue
ActionQueue getActionQueue()
-
instantiate
Object instantiate(EntityPersister persister, Object id) throws HibernateException
Description copied from interface:SharedSessionContractImplementor
Instantiate the entity class of an EntityPersister, initializing with the given identifier. This is more efficient thanSharedSessionContractImplementor.instantiate(String, Object)
but not always interchangeable: a single persister might be responsible for multiple types.- Specified by:
instantiate
in interfaceSharedSessionContractImplementor
- Throws:
HibernateException
-
forceFlush
void forceFlush(EntityEntry e) throws HibernateException
- Throws:
HibernateException
-
lock
void lock(String entityName, Object child, LockOptions lockOptions)
-
merge
@Deprecated void merge(String entityName, Object object, MergeContext copiedAlready) throws HibernateException
Deprecated.OperationalContext should cover this overload I believe- Throws:
HibernateException
-
persist
@Deprecated void persist(String entityName, Object object, PersistContext createdAlready) throws HibernateException
Deprecated.OperationalContext should cover this overload I believe- Throws:
HibernateException
-
persistOnFlush
@Deprecated void persistOnFlush(String entityName, Object object, PersistContext copiedAlready)
Deprecated.OperationalContext should cover this overload I believe
-
refresh
@Deprecated void refresh(String entityName, Object object, RefreshContext refreshedAlready) throws HibernateException
Deprecated.OperationalContext should cover this overload I believe- Throws:
HibernateException
-
delete
@Deprecated void delete(String entityName, Object child, boolean isCascadeDeleteEnabled, DeleteContext transientEntities)
Deprecated.OperationalContext should cover this overload I believe
-
removeOrphanBeforeUpdates
@Deprecated void removeOrphanBeforeUpdates(String entityName, Object child)
Deprecated.OperationalContext should cover this overload I believe
-
asSessionImplementor
default SessionImplementor asSessionImplementor()
Description copied from interface:SharedSessionContractImplementor
If this can be casted to a @SessionImplementor
, you'll get this returned after an efficient cast.- Specified by:
asSessionImplementor
in interfaceSharedSessionContractImplementor
-
isSessionImplementor
default boolean isSessionImplementor()
- Specified by:
isSessionImplementor
in interfaceSharedSessionContractImplementor
-
-