Package org.hibernate.engine.spi
Interface SessionImplementor
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable,EntityManager,HibernateEntityManager,HibernateEntityManager,HibernateEntityManagerFactoryAware,HibernateEntityManagerImplementor,JdbcSessionOwner,LobCreationContext,QueryProducer,QueryProducerImplementor,java.io.Serializable,Session,SharedSessionContract,SharedSessionContractImplementor,TransactionCoordinatorBuilder.Options,WrapperOptions
- All Known Subinterfaces:
EventSource
- All Known Implementing Classes:
SessionDelegatorBaseImpl
public interface SessionImplementor extends Session, SharedSessionContractImplementor, HibernateEntityManagerImplementor
Defines the "internal contract" forSessionand other parts of Hibernate such asType,EntityPersisterandCollectionPersisterimplementations. A Session, through this interface and SharedSessionContractImplementor, implements:-
JdbcSessionOwnerto drive the behavior of theJdbcSessionContextdelegate -
TransactionCoordinatorBuilder.Optionsto drive the creation of theTransactionCoordinatordelegate -
LobCreationContextto act as the context for JDBC LOB instance creation -
WrapperOptionsto fulfill the behavior needed while binding/extracting values to/from JDBC as part of the Type contracts
EventSourcewhich extends this interface providing bridge to the event generation features oforg.hibernate.event
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.jpa.spi.HibernateEntityManagerImplementor
HibernateEntityManagerImplementor.QueryOptions
-
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 Deprecated Methods Modifier and Type Method Description <T> RootGraphImplementor<T>createEntityGraph(java.lang.Class<T> rootType)RootGraphImplementor<?>createEntityGraph(java.lang.String graphName)QueryImplementorcreateNamedQuery(java.lang.String name)The JPA-defined named query creation method.<T> QueryImplementor<T>createNamedQuery(java.lang.String name, java.lang.Class<T> resultType)The JPA-defined named, typed query creation method.NativeQueryImplementorcreateNativeQuery(java.lang.String sqlString)Create a NativeQuery instance for the given native (SQL) queryNativeQueryImplementorcreateNativeQuery(java.lang.String sqlString, java.lang.Class resultClass)Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.NativeQueryImplementorcreateNativeQuery(java.lang.String sqlString, java.lang.String resultSetMapping)Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.QueryImplementorcreateQuery(java.lang.String queryString)Create aQueryinstance for the given HQL/JPQL query string.<T> QueryImplementor<T>createQuery(java.lang.String queryString, java.lang.Class<T> resultType)Create a typedQueryinstance for the given HQL/JPQL query string.<T> QueryImplementor<T>createQuery(java.lang.String jpaqlString, java.lang.Class<T> resultClass, Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)Deprecated.(since 5.2) - see deprecation note on superQueryImplementorcreateQuery(CriteriaDelete deleteQuery)<T> QueryImplementor<T>createQuery(CriteriaQuery<T> criteriaQuery)QueryImplementorcreateQuery(CriteriaUpdate updateQuery)NativeQueryImplementorcreateSQLQuery(java.lang.String sqlString)Create aNativeQueryinstance for the given SQL query string.voiddelete(java.lang.String entityName, java.lang.Object child, boolean isCascadeDeleteEnabled, java.util.Set transientEntities)Deprecated.OperationalContext should cover this overload I believe; Gail?voidforceFlush(EntityEntry e)ActionQueuegetActionQueue()RootGraphImplementor<?>getEntityGraph(java.lang.String graphName)NativeQueryImplementorgetNamedNativeQuery(java.lang.String name)Get a NativeQuery instance for a named native SQL queryQueryImplementorgetNamedQuery(java.lang.String queryName)Create aQueryinstance for the named query.NativeQueryImplementorgetNamedSQLQuery(java.lang.String name)Get a NativeQuery instance for a named native SQL querySessionFactoryImplementorgetSessionFactory()Get the session factory which created this session.booleanisFlushBeforeCompletionEnabled()Deprecated.(since 5.2) useSession.getHibernateFlushMode()instead.voidmerge(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)Deprecated.OperationalContext should cover this overload I believe; Gail?voidpersist(java.lang.String entityName, java.lang.Object object, java.util.Map createdAlready)Deprecated.OperationalContext should cover this overload I believe; Gail?voidpersistOnFlush(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)Deprecated.OperationalContext should cover this overload I believe; Gail?voidrefresh(java.lang.String entityName, java.lang.Object object, java.util.Map refreshedAlready)Deprecated.OperationalContext should cover this overload I believe; Gail?voidremoveOrphanBeforeUpdates(java.lang.String entityName, java.lang.Object child)Deprecated.OperationalContext should cover this overload I believe; Gail?-
Methods inherited from interface javax.persistence.EntityManager
close, contains, createNamedStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, detach, find, find, find, find, getCriteriaBuilder, getDelegate, getEntityManagerFactory, getLockMode, getMetamodel, getProperties, getReference, getTransaction, isJoinedToTransaction, isOpen, joinTransaction, lock, lock, refresh, refresh, refresh, remove, setFlushMode, setProperty, unwrap
-
Methods inherited from interface org.hibernate.jpa.spi.HibernateEntityManagerFactoryAware
getFactory
-
Methods inherited from interface org.hibernate.jpa.spi.HibernateEntityManagerImplementor
buildLockOptions, checkOpen, getLockRequest, getSession, isTransactionInProgress, markForRollbackOnly
-
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.Session
addEventListeners, buildLockRequest, byId, byId, byMultipleIds, byMultipleIds, byNaturalId, byNaturalId, bySimpleNaturalId, bySimpleNaturalId, cancelQuery, clear, contains, createFilter, delete, delete, disableFetchProfile, disableFilter, disconnect, enableFetchProfile, enableFilter, evict, flush, get, get, get, get, get, get, getCacheMode, getCurrentLockMode, getEnabledFilter, getEntityGraphs, getEntityName, getFlushMode, getHibernateFlushMode, getIdentifier, getLobHelper, getReference, getStatistics, getTypeHelper, isDefaultReadOnly, isDirty, isFetchProfileEnabled, isReadOnly, load, load, load, load, load, load, load, lock, lock, merge, merge, persist, persist, reconnect, refresh, refresh, refresh, refresh, refresh, replicate, replicate, save, save, saveOrUpdate, saveOrUpdate, sessionWithOptions, setCacheMode, setDefaultReadOnly, setFlushMode, setHibernateFlushMode, setReadOnly, update, update
-
Methods inherited from interface org.hibernate.SharedSessionContract
beginTransaction, close, createCriteria, createCriteria, createCriteria, createCriteria, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureCall, doReturningWork, doWork, getJdbcBatchSize, getNamedProcedureCall, getTransaction, isConnected, isOpen, setJdbcBatchSize
-
Methods inherited from interface org.hibernate.engine.spi.SharedSessionContractImplementor
accessTransaction, afterScrollOperation, bestGuessEntityName, checkOpen, checkOpen, checkTransactionNeededForUpdateOperation, connection, executeNativeUpdate, executeUpdate, flush, generateEntityKey, getCacheMode, getCacheTransactionSynchronization, getConfiguredJdbcBatchSize, getContextEntityIdentifier, getDontFlushFromFind, getEntityPersister, getEntityUsingInterceptor, getEventListenerManager, getExceptionConverter, getFactory, getFlushMode, getHibernateFlushMode, getInterceptor, getJdbcCoordinator, getJdbcServices, getLoadQueryInfluencers, getPersistenceContext, getPersistenceContextInternal, getSessionIdentifier, getTenantIdentifier, getTimestamp, getTransactionStartTimestamp, guessEntityName, immediateLoad, initializeCollection, instantiate, instantiate, internalLoad, isAutoCloseSessionEnabled, isClosed, isEnforcingFetchGraph, isEventSource, isOpenOrWaitingForAutoClose, isQueryParametersValidationEnabled, isTransactionInProgress, iterate, iterateFilter, list, list, list, listCustomQuery, listFilter, markForRollbackOnly, scroll, scroll, scroll, scrollCustomQuery, setAutoClear, setCacheMode, setEnforcingFetchGraph, setFlushMode, 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, remapSqlTypeDescriptor, useStreamForLobBinding
-
-
-
-
Method Detail
-
getSessionFactory
SessionFactoryImplementor getSessionFactory()
Description copied from interface:SessionGet the session factory which created this session.- Specified by:
getSessionFactoryin interfaceSession- Returns:
- The session factory.
- See Also:
SessionFactory
-
createEntityGraph
<T> RootGraphImplementor<T> createEntityGraph(java.lang.Class<T> rootType)
- Specified by:
createEntityGraphin interfaceEntityManager- Specified by:
createEntityGraphin interfaceSession
-
createEntityGraph
RootGraphImplementor<?> createEntityGraph(java.lang.String graphName)
- Specified by:
createEntityGraphin interfaceEntityManager- Specified by:
createEntityGraphin interfaceSession
-
getEntityGraph
RootGraphImplementor<?> getEntityGraph(java.lang.String graphName)
- Specified by:
getEntityGraphin interfaceEntityManager- Specified by:
getEntityGraphin interfaceSession
-
isFlushBeforeCompletionEnabled
@Deprecated boolean isFlushBeforeCompletionEnabled()
Deprecated.(since 5.2) useSession.getHibernateFlushMode()instead.
-
getActionQueue
ActionQueue getActionQueue()
-
forceFlush
void forceFlush(EntityEntry e) throws HibernateException
- Throws:
HibernateException
-
createQuery
QueryImplementor createQuery(java.lang.String queryString)
Description copied from interface:QueryProducerCreate aQueryinstance for the given HQL/JPQL query string.- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor- Specified by:
createQueryin interfaceSharedSessionContract- Parameters:
queryString- The HQL/JPQL query- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createQuery(String)
-
createQuery
<T> QueryImplementor<T> createQuery(java.lang.String queryString, java.lang.Class<T> resultType)
Description copied from interface:QueryProducerCreate a typedQueryinstance for the given HQL/JPQL query string.- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor- Specified by:
createQueryin interfaceSession- Parameters:
queryString- The HQL/JPQL queryresultType- The type of the query result- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createQuery(String,Class)
-
createNamedQuery
<T> QueryImplementor<T> createNamedQuery(java.lang.String name, java.lang.Class<T> resultType)
Description copied from interface:QueryProducerThe JPA-defined named, typed query creation method. This form can only represent an HQL/JPQL query (not a native query).- Specified by:
createNamedQueryin interfaceEntityManager- Specified by:
createNamedQueryin interfaceQueryProducer- Specified by:
createNamedQueryin interfaceQueryProducerImplementor- Specified by:
createNamedQueryin interfaceSession- Parameters:
name- the name of a query defined in metadataresultType- the type of the query result- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createNamedQuery(String,Class)
-
createNamedQuery
QueryImplementor createNamedQuery(java.lang.String name)
Description copied from interface:QueryProducerThe JPA-defined named query creation method. This form can represent an HQL/JPQL query or a native query.- Specified by:
createNamedQueryin interfaceEntityManager- Specified by:
createNamedQueryin interfaceQueryProducer- Specified by:
createNamedQueryin interfaceQueryProducerImplementor- Parameters:
name- the name of a pre-defined, named query- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createNamedQuery(String)
-
createNativeQuery
NativeQueryImplementor createNativeQuery(java.lang.String sqlString)
Description copied from interface:QueryProducerCreate a NativeQuery instance for the given native (SQL) query- Specified by:
createNativeQueryin interfaceEntityManager- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- a native SQL query string- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String)
-
createNativeQuery
NativeQueryImplementor createNativeQuery(java.lang.String sqlString, java.lang.Class resultClass)
Description copied from interface:QueryProducerCreate a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- Specified by:
createNativeQueryin interfaceEntityManager- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- Native (SQL) query stringresultClass- The Java entity type to map results to- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String,Class)
-
createNativeQuery
NativeQueryImplementor createNativeQuery(java.lang.String sqlString, java.lang.String resultSetMapping)
Description copied from interface:QueryProducerCreate a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- Specified by:
createNativeQueryin interfaceEntityManager- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Parameters:
sqlString- Native (SQL) query stringresultSetMapping- The explicit (named) result mapping- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String,Class),SqlResultSetMapping
-
createSQLQuery
NativeQueryImplementor createSQLQuery(java.lang.String sqlString)
Description copied from interface:SessionCreate aNativeQueryinstance for the given SQL query string.- Specified by:
createSQLQueryin interfaceQueryProducer- Specified by:
createSQLQueryin interfaceQueryProducerImplementor- Specified by:
createSQLQueryin interfaceSession- Parameters:
sqlString- The SQL query- Returns:
- The query instance for manipulation and execution
-
getNamedNativeQuery
NativeQueryImplementor getNamedNativeQuery(java.lang.String name)
Description copied from interface:QueryProducerGet a NativeQuery instance for a named native SQL query- Specified by:
getNamedNativeQueryin interfaceQueryProducer- Specified by:
getNamedNativeQueryin interfaceQueryProducerImplementor- Parameters:
name- The name of the pre-defined query- Returns:
- The NativeQuery instance for manipulation and execution
-
getNamedQuery
QueryImplementor getNamedQuery(java.lang.String queryName)
Description copied from interface:QueryProducerCreate aQueryinstance for the named query.- Specified by:
getNamedQueryin interfaceQueryProducer- Specified by:
getNamedQueryin interfaceQueryProducerImplementor- Specified by:
getNamedQueryin interfaceSharedSessionContract- Parameters:
queryName- the name of a pre-defined, named query- Returns:
- The Query instance for manipulation and execution
-
getNamedSQLQuery
NativeQueryImplementor getNamedSQLQuery(java.lang.String name)
Description copied from interface:QueryProducerGet a NativeQuery instance for a named native SQL query- Specified by:
getNamedSQLQueryin interfaceQueryProducer- Specified by:
getNamedSQLQueryin interfaceQueryProducerImplementor- Parameters:
name- The name of the pre-defined query- Returns:
- The NativeQuery instance for manipulation and execution
-
createQuery
<T> QueryImplementor<T> createQuery(CriteriaQuery<T> criteriaQuery)
- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceSession
-
createQuery
QueryImplementor createQuery(CriteriaUpdate updateQuery)
- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceSession
-
createQuery
QueryImplementor createQuery(CriteriaDelete deleteQuery)
- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceSession
-
createQuery
@Deprecated <T> QueryImplementor<T> createQuery(java.lang.String jpaqlString, java.lang.Class<T> resultClass, Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)
Deprecated.(since 5.2) - see deprecation note on superUsed during "compiling" a JPA criteria query.- Specified by:
createQueryin interfaceHibernateEntityManagerImplementor- Specified by:
createQueryin interfaceSharedSessionContractImplementor- Type Parameters:
T- The query type- Parameters:
jpaqlString- The criteria query rendered as a JPA QL stringresultClass- The result type (the type expected in the result list)selection- The selection(s)queryOptions- The options to use to build the query.- Returns:
- The typed query
-
merge
@Deprecated void merge(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready) throws HibernateExceptionDeprecated.OperationalContext should cover this overload I believe; Gail?- Throws:
HibernateException
-
persist
@Deprecated void persist(java.lang.String entityName, java.lang.Object object, java.util.Map createdAlready) throws HibernateExceptionDeprecated.OperationalContext should cover this overload I believe; Gail?- Throws:
HibernateException
-
persistOnFlush
@Deprecated void persistOnFlush(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)Deprecated.OperationalContext should cover this overload I believe; Gail?
-
refresh
@Deprecated void refresh(java.lang.String entityName, java.lang.Object object, java.util.Map refreshedAlready) throws HibernateExceptionDeprecated.OperationalContext should cover this overload I believe; Gail?- Throws:
HibernateException
-
delete
@Deprecated void delete(java.lang.String entityName, java.lang.Object child, boolean isCascadeDeleteEnabled, java.util.Set transientEntities)Deprecated.OperationalContext should cover this overload I believe; Gail?
-
removeOrphanBeforeUpdates
@Deprecated void removeOrphanBeforeUpdates(java.lang.String entityName, java.lang.Object child)Deprecated.OperationalContext should cover this overload I believe; Gail?
-
-