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" 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 the Type contracts
EventSource
which 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 QueryImplementor
createNamedQuery(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.NativeQueryImplementor
createNativeQuery(java.lang.String sqlString)
Create a NativeQuery instance for the given native (SQL) queryNativeQueryImplementor
createNativeQuery(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.NativeQueryImplementor
createNativeQuery(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.QueryImplementor
createQuery(java.lang.String queryString)
Create aQuery
instance for the given HQL/JPQL query string.<T> QueryImplementor<T>
createQuery(java.lang.String queryString, java.lang.Class<T> resultType)
Create a typedQuery
instance 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 superQueryImplementor
createQuery(CriteriaDelete deleteQuery)
<T> QueryImplementor<T>
createQuery(CriteriaQuery<T> criteriaQuery)
QueryImplementor
createQuery(CriteriaUpdate updateQuery)
NativeQueryImplementor
createSQLQuery(java.lang.String sqlString)
Create aNativeQuery
instance for the given SQL query string.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?void
forceFlush(EntityEntry e)
ActionQueue
getActionQueue()
NativeQueryImplementor
getNamedNativeQuery(java.lang.String name)
Get a NativeQuery instance for a named native SQL queryQueryImplementor
getNamedQuery(java.lang.String queryName)
Create aQuery
instance for the named query.NativeQueryImplementor
getNamedSQLQuery(java.lang.String name)
Get a NativeQuery instance for a named native SQL querySessionFactoryImplementor
getSessionFactory()
Get the session factory which created this session.java.lang.Object
instantiate(EntityPersister persister, java.io.Serializable id)
boolean
isFlushBeforeCompletionEnabled()
Deprecated.(since 5.2) useSession.getHibernateFlushMode()
instead.void
merge(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)
Deprecated.OperationalContext should cover this overload I believe; Gail?void
persist(java.lang.String entityName, java.lang.Object object, java.util.Map createdAlready)
Deprecated.OperationalContext should cover this overload I believe; Gail?void
persistOnFlush(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)
Deprecated.OperationalContext should cover this overload I believe; Gail?void
refresh(java.lang.String entityName, java.lang.Object object, java.util.Map refreshedAlready)
Deprecated.OperationalContext should cover this overload I believe; Gail?void
removeOrphanBeforeUpdates(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, createEntityGraph, createEntityGraph, createNamedStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, createStoredProcedureQuery, detach, find, find, find, find, getCriteriaBuilder, getDelegate, getEntityGraph, getEntityGraphs, 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, doReturningWork, doWork, enableFetchProfile, enableFilter, evict, flush, get, get, get, get, get, get, getCacheMode, getCurrentLockMode, getEnabledFilter, getEntityName, getFlushMode, getHibernateFlushMode, getIdentifier, getLobHelper, 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, 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, getSessionIdentifier, getTenantIdentifier, getTimestamp, getTransactionStartTimestamp, guessEntityName, immediateLoad, initializeCollection, instantiate, internalLoad, isAutoCloseSessionEnabled, isClosed, isEventSource, isOpenOrWaitingForAutoClose, isQueryParametersValidationEnabled, isTransactionInProgress, iterate, iterateFilter, list, list, list, listCustomQuery, listFilter, markForRollbackOnly, scroll, scroll, scroll, scrollCustomQuery, setAutoClear, setCacheMode, 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:Session
Get the session factory which created this session.- Specified by:
getSessionFactory
in interfaceSession
- Returns:
- The session factory.
- See Also:
SessionFactory
-
isFlushBeforeCompletionEnabled
@Deprecated boolean isFlushBeforeCompletionEnabled()
Deprecated.(since 5.2) useSession.getHibernateFlushMode()
instead.
-
getActionQueue
ActionQueue getActionQueue()
-
instantiate
java.lang.Object instantiate(EntityPersister persister, java.io.Serializable id) throws HibernateException
- Throws:
HibernateException
-
forceFlush
void forceFlush(EntityEntry e) throws HibernateException
- Throws:
HibernateException
-
createQuery
QueryImplementor createQuery(java.lang.String queryString)
Description copied from interface:QueryProducer
Create aQuery
instance for the given HQL/JPQL query string.- Specified by:
createQuery
in interfaceEntityManager
- Specified by:
createQuery
in interfaceQueryProducer
- Specified by:
createQuery
in interfaceQueryProducerImplementor
- Specified by:
createQuery
in 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:QueryProducer
Create a typedQuery
instance for the given HQL/JPQL query string.- Specified by:
createQuery
in interfaceEntityManager
- Specified by:
createQuery
in interfaceQueryProducer
- Specified by:
createQuery
in interfaceQueryProducerImplementor
- Specified by:
createQuery
in interfaceSession
- Parameters:
queryString
- The HQL/JPQL query- 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:QueryProducer
The JPA-defined named, typed query creation method. This form can only represent an HQL/JPQL query (not a native query).- Specified by:
createNamedQuery
in interfaceEntityManager
- Specified by:
createNamedQuery
in interfaceQueryProducer
- Specified by:
createNamedQuery
in interfaceQueryProducerImplementor
- Specified by:
createNamedQuery
in 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:QueryProducer
The JPA-defined named query creation method. This form can represent an HQL/JPQL query or a native query.- Specified by:
createNamedQuery
in interfaceEntityManager
- Specified by:
createNamedQuery
in interfaceQueryProducer
- Specified by:
createNamedQuery
in 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:QueryProducer
Create a NativeQuery instance for the given native (SQL) query- Specified by:
createNativeQuery
in interfaceEntityManager
- Specified by:
createNativeQuery
in interfaceQueryProducer
- Specified by:
createNativeQuery
in 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:QueryProducer
Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- Specified by:
createNativeQuery
in interfaceEntityManager
- Specified by:
createNativeQuery
in interfaceQueryProducer
- Specified by:
createNativeQuery
in interfaceQueryProducerImplementor
- Parameters:
sqlString
- Native (SQL) query stringresultClass
- The Java 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:QueryProducer
Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- Specified by:
createNativeQuery
in interfaceEntityManager
- Specified by:
createNativeQuery
in interfaceQueryProducer
- Specified by:
createNativeQuery
in 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:QueryProducer
Create aNativeQuery
instance for the given SQL query string.- Specified by:
createSQLQuery
in interfaceQueryProducer
- Specified by:
createSQLQuery
in interfaceQueryProducerImplementor
- Specified by:
createSQLQuery
in 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:QueryProducer
Get a NativeQuery instance for a named native SQL query- Specified by:
getNamedNativeQuery
in interfaceQueryProducer
- Specified by:
getNamedNativeQuery
in 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:QueryProducer
Create aQuery
instance for the named query.- Specified by:
getNamedQuery
in interfaceQueryProducer
- Specified by:
getNamedQuery
in interfaceQueryProducerImplementor
- Specified by:
getNamedQuery
in 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:QueryProducer
Get a NativeQuery instance for a named native SQL query- Specified by:
getNamedSQLQuery
in interfaceQueryProducer
- Specified by:
getNamedSQLQuery
in 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:
createQuery
in interfaceEntityManager
- Specified by:
createQuery
in interfaceSession
-
createQuery
QueryImplementor createQuery(CriteriaUpdate updateQuery)
- Specified by:
createQuery
in interfaceEntityManager
- Specified by:
createQuery
in interfaceSession
-
createQuery
QueryImplementor createQuery(CriteriaDelete deleteQuery)
- Specified by:
createQuery
in interfaceEntityManager
- Specified by:
createQuery
in 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:
createQuery
in interfaceHibernateEntityManagerImplementor
- 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 HibernateException
Deprecated.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 HibernateException
Deprecated.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 HibernateException
Deprecated.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?
-
-