Supplier.
When the decorated instance is readily available, one
should prefer using SessionDelegatorBaseImpl.
Another difference with SessionDelegatorBaseImpl is that this type only implements Session.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addEventListeners(SessionEventListener...
the listener(s) to add listeners)Implements org. |
| public Transaction | beginTransaction()
Implements org. Transaction object.
|
| public Session. | buildLockRequest(LockOptions
contains the lock level lockOptions)Implements org.
Deprecated
Build a new lock request that specifies:
|
| public <T> IdentifierLoadAccess | byId(String
the entity name of the entity type to be retrieved entityName)Implements org. IdentifierLoadAccess instance to retrieve an instance of the named
entity type by its primary key.
|
| public <T> IdentifierLoadAccess | byId(Class<T>
the entity type to be retrieved entityClass)Implements org. IdentifierLoadAccess instance to retrieve an instance of the given
entity type by its primary key.
|
| public <T> MultiIdentifierLoadAccess | byMultipleIds(Class<T>
the entity type to be retrieved entityClass)Implements org. MultiIdentifierLoadAccess instance to retrieve multiple instances
of the given entity type by their primary key values, using batching.
|
| public <T> MultiIdentifierLoadAccess | byMultipleIds(String
the entity name of the entity type to be retrieved entityName)Implements org. MultiIdentifierLoadAccess instance to retrieve multiple instances
of the named entity type by their primary key values, using batching.
|
| public <T> NaturalIdMultiLoadAccess | byMultipleNaturalId(Class<T>
the entity type to be retrieved entityClass)Implements org. MultiIdentifierLoadAccess instance to retrieve multiple instances
of the given entity type by their by natural id values, using batching.
|
| public <T> NaturalIdMultiLoadAccess | byMultipleNaturalId(String
the entity name of the entity type to be retrieved entityName)Implements org. MultiIdentifierLoadAccess instance to retrieve multiple instances
of the named entity type by their by natural id values, using batching.
|
| public <T> NaturalIdLoadAccess | byNaturalId(String
the entity name of the entity type to be retrieved entityName)Implements org. NaturalIdLoadAccess instance to retrieve an instance of the named
entity type by its natural id,
which may be a composite natural id. The entity must have at least one attribute
annotated org..
|
| public <T> NaturalIdLoadAccess | byNaturalId(Class<T>
the entity type to be retrieved entityClass)Implements org. NaturalIdLoadAccess instance to retrieve an instance of the given
entity type by its natural id,
which may be a composite natural id. The entity must have at least one attribute
annotated org..
|
| public <T> SimpleNaturalIdLoadAccess | bySimpleNaturalId(String
the entity name of the entity type to be retrieved entityName)Implements org. SimpleNaturalIdLoadAccess instance to retrieve an instance of the
named entity type by its natural id,
which must be a simple (non-composite) value.
|
| public <T> SimpleNaturalIdLoadAccess | bySimpleNaturalId(Class<T>
the entity type to be retrieved entityClass)Implements org. SimpleNaturalIdLoadAccess instance to retrieve an instance of the
given entity type by its natural id,
which must be a simple (non-composite) value.
|
| public void | cancelQuery()
Implements org. |
| public void | |
| public void | close()
Implements org. |
| public boolean | contains(String
the entity name entityName, Object an instance of a persistent class object)Implements org. |
| public boolean | contains(Object
entity instance entity)Implements jakarta. |
| public <T> RootGraph | createEntityGraph(Class<T>
the root entity class of the graph rootType)Implements org. EntityGraph with only a root node.
|
| public RootGraph | createEntityGraph(String
the name of the graph graphName)Implements org. EntityGraph,
or return null if there is no graph with the given
name.
|
| public <T> RootGraph | createEntityGraph(Class<T>
the root entity class of the graph rootType, String the name of the graph graphName)Implements org. EntityGraph,
or return null if there is no graph with the given
name.
|
| public MutationQuery | createMutationQuery(String hqlString)
Implements org. MutationQuery reference for the given HQL insert,
update, or delete statement.
|
| public MutationQuery | createMutationQuery(CriteriaUpdate<T> updateQuery)
Implements org. MutationQuery from the given update criteria tree
|
| public MutationQuery | createMutationQuery(CriteriaDelete<T> deleteQuery)
Implements org. MutationQuery from the given delete criteria tree
|
| public MutationQuery | createMutationQuery(JpaCriteriaInsertSelect<T> insertSelect)
Implements org. MutationQuery from the given insert-select criteria tree
|
| public MutationQuery | createNamedMutationQuery(String name)
Implements org. MutationQuery instance for the given named insert,
update, or delete HQL query.
|
| public <R> Query | createNamedQuery(String
the name of a query defined in metadata name, Class<R> the type of the query result resultClass)Implements org. TypedQuery for executing a
Jakarta Persistence query language named query.
|
| public Query | createNamedQuery(String
the name of a query defined in metadata name)Implements org.
Deprecated
Create an instance of Query for executing a named query
(in the Jakarta Persistence query language or in native SQL).
|
| public SelectionQuery | createNamedSelectionQuery(String name)
Implements org. SelectionQuery instance for the named
jakarta..
|
| public <R> SelectionQuery | createNamedSelectionQuery(String name, Class<R> resultType)
Implements org. SelectionQuery instance for the named
jakarta. with the given result type.
|
| public ProcedureCall | createNamedStoredProcedureQuery(String
The name given to the template name)Implements org. ProcedureCall based on a named template
|
| public MutationQuery | createNativeMutationQuery(String
a native SQL statement string sqlString)Implements org. NativeQuery instance for the given native SQL statement.
|
| public NativeQuery | createNativeQuery(String
a native SQL query string sqlString)Implements org.
Deprecated
Create an instance of Query for executing
a native SQL statement, e.g., for update or delete.
|
| public NativeQuery | createNativeQuery(String
a native SQL query string sqlString, Class<T> the class of the resulting instance(s) resultClass)Implements org. Query for executing
a native SQL query.
|
| public <R> NativeQuery | createNativeQuery(String
Native (SQL) query string sqlString, Class<R> The Java entity class to map results to resultClass, String The table alias for columns in the result set tableAlias)Implements org. NativeQuery instance for the given native SQL query
using an implicit mapping to the specified Java entity type.
|
| public NativeQuery | createNativeQuery(String
a native SQL query string sqlString, String the name of the result set mapping resultSetMappingName)Implements org.
Deprecated
Create an instance of Query for executing
a native SQL query.
|
| public <R> NativeQuery | createNativeQuery(String
The native (SQL) query string sqlString, String The explicit result mapping name resultSetMappingName, Class<R> resultClass)Implements org. NativeQuery instance for the given native SQL query
using an explicit mapping to the specified Java type.
|
| public <R> Query | createQuery(String
a Jakarta Persistence query string queryString, Class<R> the type of the query result resultClass)Implements org. TypedQuery for executing a
Jakarta Persistence query language statement.
|
| public Query | createQuery(String
a Jakarta Persistence query string queryString)Implements org.
Deprecated
Create an instance of Query for executing a
Jakarta Persistence query language statement.
|
| public <R> Query | createQuery(CriteriaQuery<R>
a criteria query object criteriaQuery)Implements org. TypedQuery for executing a
criteria query.
|
| public Query | createQuery(CriteriaDelete<T>
a criteria delete query object deleteQuery)Implements org.
Deprecated
Create a Query for the given JPA CriteriaDelete.
|
| public Query | createQuery(CriteriaUpdate<T>
a criteria update query object updateQuery)Implements org.
Deprecated
Create a Query for the given JPA CriteriaUpdate.
|
| public SelectionQuery | createSelectionQuery(String hqlString)
Implements org. SelectionQuery reference for the given HQL
select statement.
|
| public <R> SelectionQuery | createSelectionQuery(String
The HQL query as a string hqlString, Class<R> The resultType)Class object representing the
query result typeImplements org. SelectionQuery instance for the given HQL query
string and given query result type.
|
| public <R> SelectionQuery | createSelectionQuery(CriteriaQuery<R> criteria)
Implements org. SelectionQuery reference for the given
CriteriaQuery.
|
| public ProcedureCall | createStoredProcedureCall(String
The name of the procedure. procedureName)Implements org. ProcedureCall to a stored procedure.
|
| public ProcedureCall | createStoredProcedureCall(String
The name of the procedure. procedureName, Class<?>... The entity(s) to map the result on to. resultClasses)Implements org. ProcedureCall to a stored procedure with the given result
set entity mappings.
|
| public ProcedureCall | createStoredProcedureCall(String
The name of the procedure. procedureName, String... The explicit result set mapping(s) to use for mapping the results resultSetMappings)Implements org. ProcedureCall to a stored procedure with the given result
set entity mappings.
|
| public ProcedureCall | createStoredProcedureQuery(String
The name of the procedure. procedureName)Implements org. ProcedureCall to a stored procedure.
|
| public ProcedureCall | createStoredProcedureQuery(String
The name of the procedure. procedureName, Class<T>... The entity(s) to map the result on to. resultClasses)Implements org. ProcedureCall to a stored procedure with the given result
set entity mappings.
|
| public ProcedureCall | createStoredProcedureQuery(String
The name of the procedure. procedureName, String... The explicit result set mapping(s) to use for mapping the results resultSetMappings)Implements org. ProcedureCall to a stored procedure with the given result set
entity mappings.
|
| public void | delete(Object
the instance to be removed object)Implements org.
Deprecated
Remove a persistent instance from the datastore.
|
| public void | delete(String
the entity name for the instance to be removed. entityName, Object the instance to be removed object)Implements org.
Deprecated
Remove a persistent instance from the datastore.
|
| public void | detach(Object
the managed instance to detach object)Implements org. |
| public void | disableFetchProfile(String
the name of the fetch profile to be disabled name)Implements org. fetch profile
with the given name in this session.
|
| public void | disableFilter(String
the name of the filter to be disabled. filterName)Implements org. |
| public <T> T | doReturningWork(ReturningWork<T>
The work to be performed. work)Overrides default org. java. underlying by this session,
and return a result.
|
| public void | doWork(Work
The work to be performed. work)Overrides default org. java. underlying by this session.
|
| public void | enableFetchProfile(String
the name of the fetch profile to be enabled name)Implements org. fetch profile
with the given name in this session.
|
| public Filter | enableFilter(String
the name of the filter to be enabled. filterName)Implements org. |
| public void | evict(Object
the managed entity to evict object)Implements org. |
| public <T> @Nullable T | find(Class<T>
entity class entityClass, Object primary key primaryKey)Implements jakarta. |
| public <T> @Nullable T | |
| public <T> @Nullable T | find(Class<T>
entity class entityClass, Object primary key primaryKey, LockModeType lock mode lockMode)Implements jakarta. |
| public <T> @Nullable T | find(Class<T>
entity class entityClass, Object primary key primaryKey, LockModeType lock mode lockMode, Map<String, Object> standard and vendor-specific properties
and hints properties)Implements jakarta. |
| public void | |
| public <T> T | get(Class<T>
the entity type entityType, Object an identifier id)Implements org. |
| public <T> T | get(Class<T>
the entity type entityType, Object an identifier id, LockMode the lock mode lockMode)Implements org. |
| public <T> T | get(Class<T>
the entity type entityType, Object an identifier id, LockOptions the lock mode lockOptions)Implements org. |
| public Object | get(String
the entity name entityName, Object an identifier id)Implements org. |
| public Object | get(String
the entity name entityName, Object an identifier id, LockMode the lock mode lockMode)Implements org. |
| public Object | get(String
the entity name entityName, Object an identifier id, LockOptions contains the lock mode lockOptions)Implements org. |
| public CacheMode | getCacheMode()
Implements org. |
| public CacheRetrieveMode | getCacheRetrieveMode()
Implements org. CacheRetrieveMode.
|
| public CacheStoreMode | getCacheStoreMode()
Implements org. CacheStoreMode.
|
| public HibernateCriteriaBuilder | getCriteriaBuilder()
Implements org. HibernateCriteriaBuilder which may be used to
construct
criteria
queries.
|
| public LockMode | getCurrentLockMode(Object
a persistent instance object)Implements org. LockMode of the given managed instance associated
with this session.
|
| public Object | getDelegate()
Implements jakarta. EntityManager,
if available.
|
| public Filter | getEnabledFilter(String
the name of the filter to be retrieved. filterName)Implements org. |
| public RootGraph | getEntityGraph(String
the name of the graph graphName)Implements org. EntityGraph as an immutable graph,
or return null if there is no graph with the given
name.
|
| public <T> List | getEntityGraphs(Class<T>
entity class entityClass)Implements org. EntityGraphs with the given type.
|
| public EntityManagerFactory | getEntityManagerFactory()
Implements jakarta. |
| public String | getEntityName(Object
a persistent entity associated with this session object)Implements org. |
| public SessionFactory | getFactory()
Implements org. |
| public int | getFetchBatchSize()
Implements org. |
| public FlushModeType | getFlushMode()
Implements org. |
| public FlushMode | getHibernateFlushMode()
Implements org. |
| public Object | getIdentifier(Object
a persistent instance associated with this session object)Implements org. |
| public Integer | getJdbcBatchSize()
Implements org. |
| public LobHelper | getLobHelper()
Implements org. java.
and java..
|
| public LockModeType | getLockMode(Object
entity instance entity)Implements jakarta. |
| public Metamodel | getMetamodel()
Implements jakarta. Metamodel interface for access to the
metamodel of the persistence unit.
|
| public NativeQuery | getNamedNativeQuery(String
The name of the predefined query name)Implements org.
Deprecated
Get a NativeQuery instance for a named native SQL query
|
| public NativeQuery | getNamedNativeQuery(String
The name of the predefined query name, String resultSetMapping)Implements org.
Deprecated
Get a NativeQuery instance for a named native SQL query
|
| public ProcedureCall | getNamedProcedureCall(String
The name given to the template name)Implements org. ProcedureCall based on a named template
|
| public Query | getNamedQuery(String
the name of a predefined named query queryName)Implements org.
Deprecated
Create a Query instance for the named query.
|
| public Map | getProperties()
Implements jakarta. |
| public <T> T | getReference(Class<T>
the entity type entityType, Object the identifier of a persistent instance that exists in the database id)Implements org. |
| public Object | getReference(String
the entity name entityName, Object the identifier of a persistent instance that exists in the database id)Implements org. |
| public <T> T | getReference(T
a detached persistent instance object)Implements org. |
| public SessionFactory | getSessionFactory()
Implements org. |
| public SessionStatistics | |
| public String | getTenantIdentifier()
Implements org. |
| public Object | getTenantIdentifierValue()
Implements org. |
| public Transaction | getTransaction()
Implements org. Transaction instance associated with this session.
|
| public boolean | isConnected()
Implements org. |
| public boolean | isDefaultReadOnly()
Implements org. |
| public boolean | isDirty()
Implements org. |
| public boolean | isFetchProfileEnabled(String
the name of the profile name)Implements org. fetch profile
with the given name enabled in this session?
|
| public boolean | isJoinedToTransaction()
Implements org. |
| public boolean | isOpen()
Implements org. |
| public boolean | isReadOnly(Object
an entity or proxy entityOrProxy)Implements org. |
| public boolean | isSubselectFetchingEnabled()
Implements org. |
| public void | joinTransaction()
Implements org. |
| public <T> T | load(Class<T>
a persistent class theClass, Object a valid identifier of an existing persistent instance of the class id, LockMode the lock level lockMode)Implements org.
Deprecated
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
|
| public <T> T | load(Class<T>
a persistent class theClass, Object a valid identifier of an existing persistent instance of the class id, LockOptions contains the lock level lockOptions)Implements org.
Deprecated
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
|
| public Object | load(String
the entity name entityName, Object a valid identifier of an existing persistent instance of the class id, LockMode the lock level lockMode)Implements org.
Deprecated
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
|
| public Object | load(String
the entity name entityName, Object a valid identifier of an existing persistent instance of the class id, LockOptions contains the lock level lockOptions)Implements org.
Deprecated
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
|
| public <T> T | load(Class<T>
a persistent class theClass, Object a valid identifier of an existing persistent instance of the class id)Implements org.
Deprecated
Return the persistent instance of the given entity class with the given identifier,
making the assumption that the instance exists in the database.
|
| public Object | load(String
the entity name entityName, Object a valid identifier of an existing persistent instance of the class id)Implements org.
Deprecated
Return the persistent instance of the given entity class with the given identifier,
making the assumption that the instance exists in the database.
|
| public void | load(Object object, Object id)
Implements org. |
| public void | lock(Object
a persistent or transient instance object, LockMode the lock level lockMode)Implements org. |
| public void | lock(String
the name of the entity entityName, Object a persistent or transient instance object, LockMode the lock level lockMode)Implements org.
Deprecated
Obtain the specified lock level on the given managed instance associated
with this session.
|
| public void | lock(Object
a persistent or transient instance object, LockOptions the lock options lockOptions)Implements org. lock options.
|
| public void | lock(Object
entity instance entity, LockModeType lock mode lockMode)Implements jakarta. |
| public void | lock(Object
entity instance entity, LockModeType lock mode lockMode, Map<String, Object> standard and vendor-specific properties
and hints properties)Implements jakarta. |
| public <T> T | merge(T
a detached instance with state to be copied object)Implements org. |
| public <T> T | merge(String
the entity name entityName, T a detached instance with state to be copied object)Implements org. |
| public void | persist(Object
a transient instance to be made persistent object)Implements org. |
| public void | persist(String
the entity name entityName, Object a transient instance to be made persistent object)Implements org. |
| public void | refresh(Object
a persistent or detached instance object)Implements org. |
| public void | refresh(String
the name of the entity entityName, Object a persistent or detached instance object)Implements org.
Deprecated
Reread the state of the given managed instance associated with this session
from the underlying database.
|
| public void | refresh(Object
a persistent or detached instance object, LockMode the lock mode to use lockMode)Implements org. LockMode.
|
| public void | refresh(Object
a persistent or detached instance object, LockOptions contains the lock mode to use lockOptions)Implements org. LockMode.
|
| public void | refresh(String
the name of the entity entityName, Object a persistent or detached instance object, LockOptions contains the lock mode to use lockOptions)Implements org.
Deprecated
Reread the state of the given managed instance from the underlying database,
obtaining the given LockMode.
|
| public void | refresh(Object
entity instance entity, Map<String, Object> standard and vendor-specific properties
and hints properties)Implements jakarta. |
| public void | refresh(Object
entity instance entity, LockModeType lock mode lockMode)Implements jakarta. |
| public void | refresh(Object
entity instance entity, LockModeType lock mode lockMode, Map<String, Object> standard and vendor-specific properties
and hints properties)Implements jakarta. |
| public void | remove(Object
the managed persistent instance to remove object)Implements org. |
| public void | replicate(Object
a detached instance of a persistent class object, ReplicationMode the replication mode to use replicationMode)Implements org.
Deprecated
Persist the state of the given detached instance, reusing the current
identifier value.
|
| public void | replicate(String
the entity name entityName, Object a detached instance of a persistent class object, ReplicationMode the replication mode to use replicationMode)Implements org.
Deprecated
Persist the state of the given detached instance, reusing the current
identifier value.
|
| public Object | save(Object
a transient instance of a persistent class object)Implements org.
Deprecated
Persist the given transient instance, first assigning a generated identifier.
|
| public Object | save(String
the entity name entityName, Object a transient instance of a persistent class object)Implements org.
Deprecated
Persist the given transient instance, first assigning a generated identifier.
|
| public void | saveOrUpdate(Object
a transient or detached instance containing new or updated state object)Implements org.
Deprecated
Either 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 object)Implements org.
Deprecated
Either 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 SharedSessionBuilder | sessionWithOptions()
Implements org. Session builder with the ability to copy certain information
from this session.
|
| public void | setCacheMode(CacheMode
the new cache mode cacheMode)Implements org. |
| public void | setCacheRetrieveMode(CacheRetrieveMode
a JPA-defined cacheRetrieveMode)CacheRetrieveModeImplements org. |
| public void | setCacheStoreMode(CacheStoreMode
a JPA-defined cacheStoreMode)CacheStoreModeImplements org. |
| public void | setDefaultReadOnly(boolean
true, the default for loaded entities/proxies is read-only;
false, the default for loaded entities/proxies is modifiableImplements org. |
| public void | setFetchBatchSize(int
the maximum batch size for batch fetching batchSize)Implements org. |
| public void | setFlushMode(FlushModeType
the new flushMode)FlushModeTypeImplements org. JPA flush mode for this session.
|
| public void | setHibernateFlushMode(FlushMode
the new flushMode)FlushModeImplements org. |
| public void | setJdbcBatchSize(Integer
the new session-level JDBC batch size jdbcBatchSize)Implements org. |
| public void | setProperty(String
name of property or hint propertyName, Object value for property or hint value)Implements jakarta. |
| public void | setReadOnly(Object
an entity or proxy entityOrProxy, boolean true if the entity or proxy should be made read-only;
false if the entity or proxy should be made modifiableImplements org. |
| public void | setSubselectFetchingEnabled(boolean
true to enable subselect fetchingImplements org. |
| public <T> T | unwrap(Class<T>
the class of the object to be returned. This is
normally either the underlying cls)EntityManager implementation
class or an interface that it implements.Implements jakarta. |
| public void | update(Object
a detached instance containing updated state object)Implements org.
Deprecated
Update the persistent instance with the identifier of the given detached
instance.
|
| public void | update(String
the entity name entityName, Object a detached instance containing updated state object)Implements org.
Deprecated
Update the persistent instance with the identifier of the given detached
instance.
|