Interface SessionImplementor
- All Superinterfaces:
AutoCloseable, EntityManager, JavaType.CoercionContext, JdbcSessionOwner, LobCreationContext, QueryProducer, QueryProducerImplementor, Serializable, Session, SharedSessionContract, SharedSessionContractImplementor, TransactionCoordinatorBuilder.Options, WrapperOptions
- All Known Subinterfaces:
EventSource
- All Known Implementing Classes:
SessionDelegatorBaseImpl
Defines the "internal contract" between
Session and other parts of Hibernate
including implementors of Type, EntityPersister,
and CollectionPersister.
The Session, via this interface and SharedSessionContractImplementor,
implements:
-
JdbcSessionOwner, and so the session also acts as the orchestrator of a "JDBC session", and may be used to construct aJdbcCoordinator. -
TransactionCoordinatorBuilder.Options, allowing the session to control the creation of theTransactionCoordinatordelegate when it is passed as an argument toTransactionCoordinatorBuilder.buildTransactionCoordinator(TransactionCoordinatorOwner, TransactionCoordinatorBuilder.Options) -
LobCreationContext, and so the session may act as the context for JDBC LOB instance creation. -
WrapperOptions, and so the session may influence the process of binding and extracting values to and from JDBC, which is performed by implementors ofJdbcType.
EventSource which extends this interface,
providing a bridge to the event generation features of org.hibernate.event.-
Nested Class Summary
Nested classes/interfaces inherited from interface LobCreationContext
LobCreationContext.Callback<T> -
Method Summary
Modifier and TypeMethodDescriptiondefault <C,T> T callWithConnection(ConnectionFunction<C, T> function) <T> QueryImplementor<T> createQuery(CriteriaSelect<T> selectQuery) voidInitiate a flush to force deletion of a re-persisted entity.voidInitiate a flush to force deletion of a re-persisted entity.Get theActionQueueassociated with this session.default SessionImplementorReturns this object, fulfilling the contract ofWrapperOptions.Get the session factory which created this session.default TransactionCompletionCallbacksAccess to register callbacks for transaction completion processing.Access to registered callbacks for transaction completion processing.instantiate(EntityPersister persister, Object id) Instantiate the entity class of the givenEntityPersister, initializing the new instance with the given identifier.booleanShould this session be automatically closed after the current transaction completes?default <C> voidrunWithConnection(ConnectionConsumer<C> action) Methods inherited from interface EntityManager
close, contains, createNamedStoredProcedureQuery, createNativeQuery, createNativeQuery, createNativeQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, find, find, find, find, find, getCriteriaBuilder, getDelegate, getEntityManagerFactory, getLockMode, getMetamodel, getProperties, getTransaction, isJoinedToTransaction, isOpen, joinTransaction, lock, lock, lock, refresh, refresh, refresh, refreshMethods inherited from interface JdbcSessionOwner
afterObtainConnection, afterTransactionBegin, afterTransactionCompletion, beforeReleaseConnection, beforeTransactionCompletion, flushBeforeTransactionCompletion, getEventManager, getEventMonitor, getJdbcBatchSize, getJdbcConnectionAccess, getJdbcSessionContext, getSqlExceptionHelper, getTransactionCoordinator, startTransactionBoundaryMethods inherited from interface LobCreationContext
execute, fromContextMethods inherited from interface QueryProducer
createMutationQuery, createNamedSelectionQuery, createNamedSelectionQuery, createSelectionQuery, createSelectionQuery, createSelectionQuery, createSelectionQueryMethods inherited from interface QueryProducerImplementor
createMutationQuery, createMutationQuery, createMutationQuery, createNamedMutationQuery, createNamedQuery, createNamedQuery, createNativeMutationQuery, createNativeQuery, createNativeQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, getCacheMode, getNamedNativeQuery, getNamedNativeQuery, getNamedQueryMethods inherited from interface Session
addEventListeners, byId, byId, byMultipleIds, byMultipleIds, byMultipleNaturalId, byMultipleNaturalId, byNaturalId, byNaturalId, bySimpleNaturalId, bySimpleNaturalId, cancelQuery, clear, contains, createEntityGraph, createEntityGraph, createNamedQuery, createNamedQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, detach, disableFetchProfile, enableFetchProfile, evict, find, find, find, findMultiple, findMultiple, flush, get, get, get, get, get, get, getCacheMode, getCacheRetrieveMode, getCacheStoreMode, getCurrentLockMode, getEntityGraph, getEntityGraphs, getEntityName, getFetchBatchSize, getFlushMode, getHibernateFlushMode, getIdentifier, getLobHelper, getManagedEntities, getManagedEntities, getManagedEntities, getManagedEntities, getReference, getReference, getReference, getStatistics, isDefaultReadOnly, isDirty, isFetchProfileEnabled, isReadOnly, isSubselectFetchingEnabled, load, lock, lock, lock, merge, merge, merge, persist, persist, refresh, refresh, remove, replicate, replicate, setCacheMode, setCacheRetrieveMode, setCacheStoreMode, setDefaultReadOnly, setFetchBatchSize, setFlushMode, setHibernateFlushMode, setProperty, setReadOnly, setSubselectFetchingEnabled, unwrapMethods inherited from interface SharedSessionContract
beginTransaction, close, createEntityGraph, createNamedStoredProcedureQuery, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, disableFilter, doReturningWork, doWork, enableFilter, fromTransaction, getCriteriaBuilder, getEnabledFilter, getJdbcBatchSize, getNamedProcedureCall, getTenantIdentifier, getTenantIdentifierValue, getTransaction, inTransaction, isConnected, isJoinedToTransaction, isOpen, joinTransaction, sessionWithOptions, setJdbcBatchSize, statelessWithOptionsMethods inherited from interface SharedSessionContractImplementor
accessTransaction, afterOperation, afterScrollOperation, asEventSource, asSessionImplementor, asStatelessSession, autoFlushIfRequired, autoFlushIfRequired, autoPreFlushIfRequired, bestGuessEntityName, bestGuessEntityName, checkOpen, checkOpen, checkTransactionNeededForUpdateOperation, createEntityGraph, createEntityGraph, flush, generateEntityKey, getCacheTransactionSynchronization, getConfiguredJdbcBatchSize, getContextEntityIdentifier, getCurrentTransaction, getDialect, getEntityGraph, getEntityPersister, getEntityUsingInterceptor, getEventListenerManager, getExceptionConverter, getFactory, getHibernateFlushMode, getInterceptor, getJdbcCoordinator, getJdbcServices, getLoadQueryInfluencers, getNativeJdbcParametersIgnored, getPersistenceContext, getPersistenceContextInternal, getSessionAssociationMarkers, getSessionIdentifier, getSessionToken, getTypeConfiguration, guessEntityName, immediateLoad, initializeCollection, instantiate, internalLoad, isClosed, isCriteriaCopyTreeEnabled, isCriteriaPlanCacheEnabled, isDefaultReadOnly, isEventSource, isIdentifierRollbackEnabled, isManaged, isOpenOrWaitingForAutoClose, isSessionImplementor, isStateless, isStatelessSession, isTransactionInProgress, loadFromSecondLevelCache, lock, markForRollbackOnly, prepareForQueryExecution, setCriteriaCopyTreeEnabled, setCriteriaPlanCacheEnabled, setNativeJdbcParametersIgnoredMethods inherited from interface TransactionCoordinatorBuilder.Options
shouldAutoJoinTransactionMethods inherited from interface WrapperOptions
getJdbcTimeZone, getJsonFormatMapper, getLobCreator, getPreferredSqlTypeCodeForBoolean, getXmlFormatMapper, useLanguageTagForLocale, useStreamForLobBinding
-
Method Details
-
getSession
Description copied from interface:SharedSessionContractImplementorReturns this object, fulfilling the contract ofWrapperOptions.- Specified by:
getSessionin interfaceSharedSessionContractImplementor- Specified by:
getSessionin interfaceWrapperOptions
-
getSessionFactory
SessionFactoryImplementor getSessionFactory()Description copied from interface:SessionGet the session factory which created this session.- Specified by:
getSessionFactoryin interfaceSession- Specified by:
getSessionFactoryin interfaceSharedSessionContractImplementor- Specified by:
getSessionFactoryin interfaceWrapperOptions- Returns:
- the session factory
- See Also:
-
createQuery
- Specified by:
createQueryin interfaceEntityManager
-
getActionQueue
ActionQueue getActionQueue()Get theActionQueueassociated with this session. -
getTransactionCompletionCallbacks
Description copied from interface:SharedSessionContractImplementorAccess to register callbacks for transaction completion processing.- Specified by:
getTransactionCompletionCallbacksin interfaceSharedSessionContractImplementor
-
getTransactionCompletionCallbacksImplementor
Description copied from interface:SharedSessionContractImplementorAccess to registered callbacks for transaction completion processing.- Specified by:
getTransactionCompletionCallbacksImplementorin interfaceSharedSessionContractImplementor
-
isAutoCloseSessionEnabled
boolean isAutoCloseSessionEnabled()Should this session be automatically closed after the current transaction completes? -
instantiate
Description copied from interface:SharedSessionContractImplementorInstantiate the entity class of the givenEntityPersister, initializing the new instance with the given identifier.This is more efficient than
SharedSessionContractImplementor.instantiate(String, Object), but not always interchangeable, since a single persister might be responsible for multiple types.- Specified by:
instantiatein interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
forceFlush
Initiate a flush to force deletion of a re-persisted entity.- Throws:
HibernateException
-
forceFlush
Initiate a flush to force deletion of a re-persisted entity.- Throws:
HibernateException
-
runWithConnection
- Specified by:
runWithConnectionin interfaceEntityManager
-
callWithConnection
- Specified by:
callWithConnectionin interfaceEntityManager
-