Deprecated
as a consequence of AbstractSessionImpl, EventSource, SessionImplementor and HibernateEntityManagerImplementor being deprecated. See corresponding docs for further information.
Exposes two interfaces:
org.hibernate.Session to the applicationorg.hibernate.engine.spi.SessionImplementor to other Hibernate components (SPI)This class is not thread-safe.
| Modifier and Type | Class and Description |
|---|---|
| private abstract class | |
| private class | |
| private static class | |
| private class | |
| private class | |
| private class | |
| private static class | SessionImpl.SharedSessionBuilderImpl<T extends SharedSessionBuilder
|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private transient ActionQueue | |
| private boolean | |
| private boolean | |
| private transient int | |
| private transient boolean | |
| private transient LoadEvent | |
| private transient LoadQueryInfluencers | |
| private transient SessionImpl. | |
| private LockOptions | |
| private static final EntityManagerMessageLogger | |
| private transient StatefulPersistenceContext | |
| private Map | |
| private boolean | |
| private transient TransactionObserver |
| Access | Constructor and Description |
|---|---|
| public | SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options)
Deprecated
as a consequence of
SessionFactoryImpl being deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | addEventListeners(SessionEventListener...
The listener(s) to add listeners)Implements org. |
| protected void | |
| public void | afterOperation(boolean
Was the operation a success success)Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, make sure the connection has been committed (if it is not in autocommit mode) and run the after completion processing |
| public void | |
| public void | afterTransactionBegin()
Implements org. |
| public void | afterTransactionCompletion(boolean
Was the transaction successful? successful, boolean Is this a delayed after transaction completion call (aka after a timeout)? delayed)Overrides org. Implements org. |
| protected void | applyQuerySettingsAndHints(Query<R> query)
Overrides org.
Deprecated
as a consequence of
Query being deprecated.
|
| protected boolean | autoFlushIfRequired(Set<E> querySpaces)
detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flush |
| public void | beforeTransactionCompletion()
Overrides org. Implements org. |
| public String | bestGuessEntityName(Object object)
Implements org. |
| public Session. | buildLockRequest(LockOptions
contains the lock level lockOptions)Implements org. |
| public SessionImpl. | byId(String
The entity name of the entity type to be retrieved entityName)Implements org. IdentifierLoadAccess instance to retrieve the specified entity type by
primary key.
|
| public <T> SessionImpl. | byId(Class<T>
The entity type to be retrieved entityClass)Implements org. IdentifierLoadAccess instance to retrieve the specified entity by
primary key.
|
| public <T> MultiIdentifierLoadAccess | byMultipleIds(Class<T>
The entity type to be retrieved entityClass)Implements org. MultiIdentifierLoadAccess instance to retrieve multiple entities at once
as specified by primary key values.
|
| public MultiIdentifierLoadAccess | byMultipleIds(String
The entity name of the entity type to be retrieved entityName)Implements org. MultiIdentifierLoadAccess instance to retrieve multiple entities at once
as specified by primary key values.
|
| public NaturalIdLoadAccess | byNaturalId(String
The entity name of the entity type to be retrieved entityName)Implements org. NaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.
|
| public <T> NaturalIdLoadAccess | byNaturalId(Class<T>
The entity type to be retrieved entityClass)Implements org. NaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.
|
| public SimpleNaturalIdLoadAccess | bySimpleNaturalId(String
The entity name of the entity type to be retrieved entityName)Implements org. SimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.
|
| public <T> SimpleNaturalIdLoadAccess | bySimpleNaturalId(Class<T>
The entity type to be retrieved entityClass)Implements org. SimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its simple (single attribute) natural id.
|
| public void | cancelQuery()
Implements org. |
| protected void | |
| protected void | |
| protected void | |
| private void | |
| protected void | cleanupOnClose()
Overrides org. |
| public void | clear()
Implements org. |
| public void | close()
Overrides org. Implements org. |
| public void | |
| private Map | |
| public Connection | |
| public boolean | contains(Object
entity instance object)Implements javax. |
| public boolean | contains(String
The entity name entityName, Object an instance of a persistent class object)Implements org. |
| protected ActionQueue | |
| private ClearEvent | |
| public Criteria | createCriteria(Class<T>
The class, which is an entity, or has entity subclasses/implementors persistentClass, String The alias to use alias)Implements org. Criteria instance for the given class (entity or subclasses/implementors), using a specific
alias.
|
| public Criteria | createCriteria(String
The entity name entityName, String The alias to use alias)Implements org. Criteria instance for the given entity name, using a specific alias.
|
| public Criteria | createCriteria(Class<T>
The class, which is an entity, or has entity subclasses/implementors persistentClass)Implements org. Criteria instance for the given class (entity or subclasses/implementors).
|
| public Criteria | createCriteria(String
The entity name entityName)Implements org. Criteria instance for the given entity name.
|
| public <T> RootGraphImplementor | createEntityGraph(Class<T>
class of entity graph rootType)Implements org. |
| public RootGraphImplementor | createEntityGraph(String
name of an entity graph graphName)Implements org. |
| public Query | createFilter(Object
a persistent collection collection, String a Hibernate query fragment. queryString)Implements org.
Deprecated
as a consequence of
Create a Query being deprecated.
Query instance for the given collection and filter string.
|
| public StoredProcedureQuery | createNamedStoredProcedureQuery(String
name assigned to the stored procedure query
in metadata name)Implements javax. StoredProcedureQuery for executing a
stored procedure in the database.
|
| protected StatefulPersistenceContext | |
| public ProcedureCall | createStoredProcedureCall(String
The name of the procedure. procedureName)Overrides org. Implements org.
Deprecated
as a consequence of
Creates a call to a stored procedure.
ProcedureCall being deprecated.
|
| public ProcedureCall | createStoredProcedureCall(String
The name of the procedure. procedureName, String... The explicit result set mapping(s) to use for mapping the results resultSetMappings)Overrides org. Implements org.
Deprecated
as a consequence of
Creates a call to a stored procedure with specific result set entity mappings.
ProcedureCall being deprecated.
|
| public ProcedureCall | createStoredProcedureCall(String
The name of the procedure. procedureName, Class<T>... The entity(s) to map the result on to. resultClasses)Overrides org. Implements org.
Deprecated
as a consequence of
Creates a call to a stored procedure with specific result set entity mappings.
ProcedureCall being deprecated.
|
| public StoredProcedureQuery | createStoredProcedureQuery(String
name of the stored procedure in the
database procedureName)Implements javax. StoredProcedureQuery for executing a
stored procedure in the database.
|
| public StoredProcedureQuery | createStoredProcedureQuery(String
name of the stored procedure in the
database procedureName, Class<T>... classes to which the result sets
produced by the stored procedure are to
be mapped resultClasses)Implements javax. StoredProcedureQuery for executing a
stored procedure in the database.
|
| public StoredProcedureQuery | createStoredProcedureQuery(String
name of the stored procedure in the
database procedureName, String... the names of the result set mappings
to be used in mapping result sets
returned by the stored procedure resultSetMappings)Implements javax. StoredProcedureQuery for executing a
stored procedure in the database.
|
| protected void | |
| public void | delete(Object
the instance to be removed object)Implements org. |
| public void | delete(String
The entity name for the instance to be removed. entityName, Object the instance to be removed object)Implements org. |
| public void | delete(String entityName, Object object, boolean isCascadeDeleteEnabled, Set<E> transientEntities)
Implements org. |
| public void | detach(Object
entity instance entity)Implements javax. |
| protected CacheMode | |
| private static CacheRetrieveMode | |
| private static CacheStoreMode | |
| public void | disableFetchProfile(String
The name of the fetch profile to be disabled. name)Implements org. |
| public void | disableFilter(String
The name of the filter to be disabled. filterName)Implements org. |
| public Connection | disconnect()
Implements org. |
| private void | |
| public void | enableFetchProfile(String
The name of the fetch profile to be enabled. name)Implements org. |
| public Filter | enableFilter(String
The name of the filter to be enabled. filterName)Implements org. |
| public void | evict(Object
The entity to evict object)Implements org. |
| public int | executeNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters)
Implements org. |
| public int | executeUpdate(String query, QueryParameters queryParameters)
Implements org. |
| public <T> T | find(Class<T>
entity class entityClass, Object primary key primaryKey)Implements javax. |
| public <T> T | |
| public <T> T | find(Class<T>
entity class entityClass, Object primary key primaryKey, LockModeType lock mode lockModeType)Implements javax. |
| public <T> T | find(Class<T>
entity class entityClass, Object primary key primaryKey, LockModeType lock mode lockModeType, Map<String, Object> standard and vendor-specific properties
and hints properties)Implements javax. |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private Object | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private Serializable | |
| private void | |
| private void | |
| public void | flush()
Implements org. |
| public void | |
| public void | forceFlush(EntityEntry entityEntry)
Implements org. |
| public <T> T | get(Class<T>
The entity type entityClass, Serializable an identifier id)Implements org. |
| public Object | get(String
the entity name entityName, Serializable an identifier id)Implements org. |
| public <T> T | get(Class<T>
The entity type entityClass, Serializable an identifier id, LockMode the lock mode lockMode)Implements org. |
| public <T> T | get(Class<T>
The entity type entityClass, Serializable an identifier id, LockOptions the lock mode lockOptions)Implements org. |
| public Object | get(String
the entity name entityName, Serializable an identifier id, LockMode the lock mode lockMode)Implements org. |
| public Object | get(String
the entity name entityName, Serializable an identifier id, LockOptions contains the lock mode lockOptions)Implements org. |
| public ActionQueue | getActionQueue()
Implements org. |
| public Serializable | getContextEntityIdentifier(Object object)
Implements org. |
| public CriteriaBuilder | getCriteriaBuilder()
Implements javax. CriteriaBuilder for the creation of
CriteriaQuery objects.
|
| public LockMode | getCurrentLockMode(Object
a persistent instance object)Implements org. |
| public Object | getDelegate()
Implements javax. EntityManager,
if available.
|
| public int | |
| public Filter | getEnabledFilter(String
The name of the filter to be retrieved. filterName)Implements org. |
| public RootGraphImplementor | getEntityGraph(String
name of an existing entity graph graphName)Implements org. |
| public List | getEntityGraphs(Class<T>
entity class entityClass)Overrides default org. Implements javax. |
| public SessionFactoryImplementor | getEntityManagerFactory()
Implements javax.
Deprecated
as a consequence of
Return the entity manager factory for the entity manager.
SessionFactoryImplementor being deprecated.
|
| public String | getEntityName(Object
a persistent entity object)Implements org. |
| public EntityPersister | getEntityPersister(final String
optional entity name entityName, final Object the entity instance object)Implements org. |
| public Object | getEntityUsingInterceptor(EntityKey key)
Implements org. |
| private FilterQueryPlan | |
| public Serializable | getIdentifier(Object
a persistent instance object)Implements org. |
| public LoadQueryInfluencers | getLoadQueryInfluencers()
Implements org. |
| public LobHelper | getLobHelper()
Implements org. |
| public LockModeType | getLockMode(Object
entity instance entity)Implements javax. |
| private LockOptions | |
| private LockOptions | |
| public LockOptions | getLockRequest(LockModeType
is the requested lock type lockModeType, Map<String, Object> are the lock properties properties)Implements org. javax. & properties into org.
|
| public MetamodelImplementor | getMetamodel()
Implements javax. Metamodel interface for access to the
metamodel of the persistence unit.
|
| private OuterJoinLoadable | |
| public PersistenceContext | getPersistenceContext()
Implements org. |
| public PersistenceContext | getPersistenceContextInternal()
Implements org. getPersistenceContext(), with
two main differences:
a) this version performs better as
it allows for inlining and probably better prediction
b) see SessionImplgetPersistenceContext() : it
does some checks on the current state of the Session.
|
| public Map | getProperties()
Implements javax. |
| private Serializable | |
| private Boolean | |
| public <T> T | getReference(T
a detached persistent instance object)Overrides default org. |
| public <T> T | getReference(Class<T>
entity class entityClass, Object primary key primaryKey)Implements javax. |
| public SessionImplementor | getSession()
Implements org.
Deprecated
as a consequence of
Retrieve a reference to the Hibernate SessionImplementor being deprecated.
org. used by this javax..
|
| public SessionFactoryImplementor | getSessionFactory()
Implements org.
Deprecated
as a consequence of
Get the session factory which created this session.
SessionFactoryImplementor being deprecated.
|
| private Object | |
| public SessionStatistics | |
| private Transaction | |
| public TypeHelper | getTypeHelper()
Implements org. TypeHelper associated with this session's SessionFactory.
|
| public String | guessEntityName(Object object)
Implements org. |
| public Object | immediateLoad(String entityName, Serializable id)
Implements org. |
| public void | initializeCollection(PersistentCollection collection, boolean writing)
Implements org. |
| protected void | initQueryFromNamedDefinition(Query<R> query, NamedQueryDefinition namedQueryDefinition)
Overrides org.
Deprecated
as a consequence of
Query being deprecated.
|
| public Object | instantiate(String entityName, Serializable id)
Implements org. |
| public Object | instantiate(EntityPersister persister, Serializable id)
Implements org. |
| private void | |
| public Object | internalLoad(String entityName, Serializable id, boolean eager, boolean nullable)
Implements org. |
| public boolean | |
| public boolean | isDefaultReadOnly()
Implements org. |
| public boolean | isDirty()
Implements org. |
| public boolean | |
| public boolean | |
| public boolean | isFetchProfileEnabled(String
The name of the profile to be checked. name)Implements org. |
| public boolean | |
| public boolean | isJoinedToTransaction()
Implements javax. |
| public boolean | isOpen()
Overrides org. Implements org. |
| public boolean | |
| public boolean | isReadOnly(Object
an entity or HibernateProxy entityOrProxy)Implements org. |
| private boolean | |
| private boolean | |
| public Iterator | iterate(String query, QueryParameters queryParameters)
Implements org. |
| public Iterator | iterateFilter(Object collection, String filter, QueryParameters queryParameters)
Implements org. |
| public void | joinTransaction()
Implements javax. |
| private void | |
| public List | list(String query, QueryParameters queryParameters)
Implements org. |
| public List | list(Criteria criteria)
Implements org. |
| public List | listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)
Implements org. |
| public List | listFilter(Object collection, String filter, QueryParameters queryParameters)
Implements org. |
| public void | load(Object
an "empty" instance of the persistent class object, Serializable a valid identifier of an existing persistent instance of the class id)Implements org. |
| public <T> T | load(Class<T>
a persistent class entityClass, Serializable a valid identifier of an existing persistent instance of the class id)Implements org. |
| public Object | load(String
a persistent class entityName, Serializable a valid identifier of an existing persistent instance of the class id)Implements abstract org. Implements org. |
| public <T> T | load(Class<T>
a persistent class entityClass, Serializable a valid identifier of an existing persistent instance of the class id, LockMode the lock level lockMode)Implements org. |
| public <T> T | load(Class<T>
a persistent class entityClass, Serializable a valid identifier of an existing persistent instance of the class id, LockOptions contains the lock level lockOptions)Implements org. |
| public Object | load(String
a persistent class entityName, Serializable a valid identifier of an existing persistent instance of the class id, LockMode the lock level lockMode)Implements org. |
| public Object | load(String
a persistent class entityName, Serializable a valid identifier of an existing persistent instance of the class id, LockOptions contains the lock level lockOptions)Implements org. |
| private EntityPersister | |
| private EntityPersister | |
| public void | lock(String
The name of the entity entityName, Object a persistent or transient instance object, LockMode the lock level lockMode)Implements org. |
| public void | lock(Object
a persistent or transient instance object, LockMode the lock level lockMode)Implements org. |
| public void | lock(Object
entity instance entity, LockModeType lock mode lockModeType)Implements javax. |
| public void | lock(Object
entity instance entity, LockModeType lock mode lockModeType, Map<String, Object> standard and vendor-specific properties
and hints properties)Implements javax. |
| private void | |
| private void | |
| private void | |
| public Object | merge(String
The entity name entityName, Object a detached instance with state to be copied object)Implements org. |
| public Object | merge(Object
a detached instance with state to be copied object)Implements org. |
| public void | merge(String entityName, Object object, Map<K, V> copiedAlready)
Implements org. |
| public void | persist(String
The entity name entityName, Object a transient instance to be made persistent object)Implements org. |
| public void | persist(Object
a transient instance to be made persistent object)Implements org. |
| public void | persist(String entityName, Object object, Map<K, V> copiedAlready)
Implements org. |
| public void | persistOnFlush(String entityName, Object object, Map<K, V> copiedAlready)
Implements org. |
| private void | readObject(ObjectInputStream
The input stream from which we are being read... ois)Hides org. |
| public void | reconnect(Connection
a JDBC connection conn)Implements org. |
| private LoadEvent | recycleEventInstance(final LoadEvent event, final Serializable id, final String entityName)
Helper to avoid creating many new instances of LoadEvent: it's an allocation hot spot. |
| public void | refresh(Object
a persistent or detached instance object)Implements org. |
| public void | refresh(String
a persistent class entityName, Object a persistent or detached instance object)Implements org. |
| public void | refresh(Object
a persistent or detached instance object, LockMode the lock mode to use lockMode)Implements org. |
| public void | refresh(Object
a persistent or detached instance object, LockOptions contains the lock mode to use lockOptions)Implements org. |
| public void | refresh(String
a persistent class entityName, Object a persistent or detached instance object, LockOptions contains the lock mode to use lockOptions)Implements org. |
| public void | refresh(String entityName, Object object, Map<K, V> refreshedAlready)
Implements org. |
| public void | refresh(Object
entity instance entity, Map<String, Object> standard and vendor-specific properties
and hints properties)Implements javax. |
| public void | refresh(Object
entity instance entity, LockModeType lock mode lockModeType)Implements javax. |
| public void | refresh(Object
entity instance entity, LockModeType lock mode lockModeType, Map<String, Object> standard and vendor-specific properties
and hints properties)Implements javax. |
| public void | remove(Object
entity instance entity)Implements javax. |
| public void | removeOrphanBeforeUpdates(String entityName, Object child)
Implements org. |
| protected void | |
| public void | replicate(Object
a detached instance of a persistent class obj, ReplicationMode The replication mode to use replicationMode)Implements org. |
| public void | replicate(String
The entity name entityName, Object a detached instance of a persistent class obj, ReplicationMode The replication mode to use replicationMode)Implements org. |
| public Serializable | save(Object
a transient instance of a persistent class obj)Implements org. |
| public Serializable | save(String
The entity name entityName, Object a transient instance of a persistent class object)Implements org. |
| public void | saveOrUpdate(Object
a transient or detached instance containing new or updated state object)Implements org. save(Object) or update(Object) the given
instance, depending upon resolution of the unsaved-value checks (see the
manual for discussion of unsaved-value checking).
|
| public void | saveOrUpdate(String
The entity name entityName, Object a transient or detached instance containing new or updated state obj)Implements org. save(String, Object) or update(String, Object)
the given instance, depending upon resolution of the unsaved-value checks
(see the manual for discussion of unsaved-value checking).
|
| public ScrollableResultsImplementor | scroll(String query, QueryParameters queryParameters)
Implements org. |
| public ScrollableResultsImplementor | scroll(Criteria criteria, ScrollMode scrollMode)
Implements org. |
| public ScrollableResultsImplementor | scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)
Implements org. |
| public SharedSessionBuilder | sessionWithOptions()
Implements org. Session builder with the ability to grab certain information from this session.
|
| public void | setAutoClear(boolean enabled)
Implements org. |
| public void | setDefaultReadOnly(boolean
true, the default for loaded entities/proxies is read-only;
false, the default for loaded entities/proxies is modifiable defaultReadOnly)Implements org. |
| public void | setEnforcingFetchGraph(boolean isEnforcingFetchGraph)
Overrides default org. |
| public void | setFlushMode(FlushModeType
flush mode flushModeType)Implements javax. |
| public void | setProperty(String
name of property or hint propertyName, Object value for property or hint value)Implements javax. |
| public void | setReadOnly(Object
an entity or HibernateProxy entity, boolean true if the entity or proxy should be made read-only; false if the entity or
proxy should be made modifiableImplements org. |
| public boolean | |
| protected boolean | shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared)
Overrides org. |
| public void | startTransactionBoundary()
Overrides org. Implements org. org. API or via registration
of Hibernate's JTA Synchronization impl with a JTA Transaction
|
| private void | |
| public String | |
| private NaturalIdLoadAccess | Returns: A fully configured NaturalIdLoadAccess or null, if null is returned the standard CriteriaImpl execution should be performedThe criteria to check as a complete natural identifier lookup. criteria)Checks to see if the CriteriaImpl is a naturalId lookup that can be done via NaturalIdLoadAccess |
| public <T> T | unwrap(Class<T>
the class of the object to be returned. This is
normally either the underlying clazz)EntityManager implementation
class or an interface that it implements.Implements javax. |
| public void | update(Object
a detached instance containing updated state obj)Implements org. |
| public void | update(String
The entity name entityName, Object a detached instance containing updated state object)Implements org. |
| protected void | |
| private void | writeObject(ObjectOutputStream
The output stream to which we are being written... oos)Hides org. |