public class SessionDelegatorBaseImpl extends Object implements SessionImplementor
SessionImplementor and
a Session. This is useful for custom implementations of this
API so that only some methods need to be overridden
(Used by Hibernate Search).Session.LockRequestLobCreationContext.Callback<T>HibernateEntityManagerImplementor.QueryOptions| Modifier and Type | Field and Description |
|---|---|
protected SessionImplementor |
delegate |
| Constructor and Description |
|---|
SessionDelegatorBaseImpl(SessionImplementor delegate) |
SessionDelegatorBaseImpl(SessionImplementor delegate,
Session session)
Deprecated.
(since 5.3) SessionDelegatorBaseImpl should take just one argument, the SessionImplementor.
Use the
SessionDelegatorBaseImpl(SessionImplementor) form instead |
| Modifier and Type | Method and Description |
|---|---|
Transaction |
accessTransaction()
Provides access to the underlying transaction or creates a new transaction if
one does not already exist or is active.
|
void |
addEventListeners(SessionEventListener... listeners)
Add one or more listeners to the Session
|
void |
afterScrollOperation() |
void |
afterTransactionBegin()
A after-begin callback from the coordinator to its owner.
|
void |
afterTransactionCompletion(boolean successful,
boolean delayed)
An after-completion callback to the owner.
|
void |
beforeTransactionCompletion()
A before-completion callback to the owner.
|
Transaction |
beginTransaction()
Begin a unit of work and return the associated
Transaction object. |
String |
bestGuessEntityName(Object object)
The best guess entity name for an entity not in an association
|
LockOptions |
buildLockOptions(LockModeType lockModeType,
Map<String,Object> properties)
Given a JPA
LockModeType and properties, build a Hibernate
LockOptions |
Session.LockRequest |
buildLockRequest(LockOptions lockOptions)
Build a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope.
|
<T> IdentifierLoadAccess<T> |
byId(Class<T> entityClass)
Create an
IdentifierLoadAccess instance to retrieve the specified entity by
primary key. |
IdentifierLoadAccess |
byId(String entityName)
Create an
IdentifierLoadAccess instance to retrieve the specified entity type by
primary key. |
<T> MultiIdentifierLoadAccess<T> |
byMultipleIds(Class<T> entityClass)
Create a
MultiIdentifierLoadAccess instance to retrieve multiple entities at once
as specified by primary key values. |
MultiIdentifierLoadAccess |
byMultipleIds(String entityName)
Create a
MultiIdentifierLoadAccess instance to retrieve multiple entities at once
as specified by primary key values. |
<T> NaturalIdLoadAccess<T> |
byNaturalId(Class<T> entityClass)
Create a
NaturalIdLoadAccess instance to retrieve the specified entity by
its natural id. |
NaturalIdLoadAccess |
byNaturalId(String entityName)
Create a
NaturalIdLoadAccess instance to retrieve the specified entity by
its natural id. |
<T> SimpleNaturalIdLoadAccess<T> |
bySimpleNaturalId(Class<T> entityClass)
Create a
SimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its simple (single attribute) natural id. |
SimpleNaturalIdLoadAccess |
bySimpleNaturalId(String entityName)
Create a
SimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id. |
void |
cancelQuery()
Cancel the execution of the current query.
|
void |
checkOpen()
Performs a check whether the Session is open, and if not:
marks current transaction (if one) for rollback only
throws an IllegalStateException (JPA defines the exception type)
|
void |
checkOpen(boolean markForRollbackIfClosed)
Performs a check whether the Session is open, and if not:
if
markForRollbackIfClosed is true, marks current transaction (if one) for rollback only
throws an IllegalStateException (JPA defines the exception type)
|
void |
checkTransactionNeededForUpdateOperation(String exceptionMessage)
Check if an active Transaction is necessary for the update operation to be executed.
|
void |
clear()
Completely clear the session.
|
void |
close()
End the session by releasing the JDBC connection and cleaning up.
|
Connection |
connection() |
boolean |
contains(Object object) |
boolean |
contains(String entityName,
Object object)
Check if this entity is associated with this Session.
|
Criteria |
createCriteria(Class persistentClass)
Create
Criteria instance for the given class (entity or subclasses/implementors). |
Criteria |
createCriteria(Class persistentClass,
String alias)
Create
Criteria instance for the given class (entity or subclasses/implementors), using a specific
alias. |
Criteria |
createCriteria(String entityName)
Create
Criteria instance for the given entity name. |
Criteria |
createCriteria(String entityName,
String alias)
Create
Criteria instance for the given entity name, using a specific alias. |
<T> RootGraphImplementor<T> |
createEntityGraph(Class<T> rootType) |
RootGraphImplementor<?> |
createEntityGraph(String graphName) |
Query |
createFilter(Object collection,
String queryString)
Create a
Query instance for the given collection and filter string. |
QueryImplementor |
createNamedQuery(String name)
The JPA-defined named query creation method.
|
<T> QueryImplementor<T> |
createNamedQuery(String name,
Class<T> resultClass)
The JPA-defined named, typed query creation method.
|
StoredProcedureQuery |
createNamedStoredProcedureQuery(String name) |
NativeQueryImplementor |
createNativeQuery(String sqlString)
Create a NativeQuery instance for the given native (SQL) query
|
NativeQueryImplementor |
createNativeQuery(String sqlString,
Class resultClass)
Create a NativeQuery instance for the given native (SQL) query using
implicit mapping to the specified Java type.
|
NativeQueryImplementor |
createNativeQuery(String sqlString,
String resultSetMapping)
Create a NativeQuery instance for the given native (SQL) query using
implicit mapping to the specified Java type.
|
QueryImplementor |
createQuery(CriteriaDelete deleteQuery) |
<T> QueryImplementor<T> |
createQuery(CriteriaQuery<T> criteriaQuery) |
QueryImplementor |
createQuery(CriteriaUpdate updateQuery) |
QueryImplementor |
createQuery(String queryString)
Create a
Query instance for the given HQL/JPQL query string. |
<T> QueryImplementor<T> |
createQuery(String queryString,
Class<T> resultType)
Create a typed
Query instance for the given HQL/JPQL query string. |
<T> QueryImplementor<T> |
createQuery(String jpaqlString,
Class<T> resultClass,
Selection selection,
HibernateEntityManagerImplementor.QueryOptions queryOptions)
Used during "compiling" a JPA criteria query.
|
NativeQueryImplementor |
createSQLQuery(String queryString)
Create a
NativeQuery instance for the given SQL query string. |
ProcedureCall |
createStoredProcedureCall(String procedureName)
Creates a call to a stored procedure.
|
ProcedureCall |
createStoredProcedureCall(String procedureName,
Class... resultClasses)
Creates a call to a stored procedure with specific result set entity mappings.
|
ProcedureCall |
createStoredProcedureCall(String procedureName,
String... resultSetMappings)
Creates a call to a stored procedure with specific result set entity mappings.
|
StoredProcedureQuery |
createStoredProcedureQuery(String procedureName) |
StoredProcedureQuery |
createStoredProcedureQuery(String procedureName,
Class... resultClasses) |
StoredProcedureQuery |
createStoredProcedureQuery(String procedureName,
String... resultSetMappings) |
protected SessionImplementor |
delegate()
Returns the underlying delegate.
|
void |
delete(Object object)
Remove a persistent instance from the datastore.
|
void |
delete(String entityName,
Object object)
Remove a persistent instance from the datastore.
|
void |
delete(String entityName,
Object child,
boolean isCascadeDeleteEnabled,
Set transientEntities) |
void |
detach(Object entity) |
void |
disableFetchProfile(String name)
Disable a particular fetch profile on this session.
|
void |
disableFilter(String filterName)
Disable the named filter for the current session.
|
Connection |
disconnect()
Disconnect the session from its underlying JDBC connection.
|
<T> T |
doReturningWork(ReturningWork<T> work)
Controller for allowing users to perform JDBC related work using the Connection managed by this Session.
|
void |
doWork(Work work)
Controller for allowing users to perform JDBC related work using the Connection managed by this Session.
|
void |
enableFetchProfile(String name)
Enable a particular fetch profile on this session.
|
Filter |
enableFilter(String filterName)
Enable the named filter for this current session.
|
void |
evict(Object object)
Remove this instance from the session cache.
|
<T> T |
execute(LobCreationContext.Callback<T> callback)
Execute the given callback, making sure it has access to a viable JDBC
Connection. |
int |
executeNativeUpdate(NativeSQLQuerySpecification specification,
QueryParameters queryParameters)
Execute a native SQL update or delete query
|
int |
executeUpdate(String query,
QueryParameters queryParameters)
Execute a HQL update or delete query
|
<T> T |
find(Class<T> entityClass,
Object primaryKey) |
<T> T |
find(Class<T> entityClass,
Object primaryKey,
LockModeType lockMode) |
<T> T |
find(Class<T> entityClass,
Object primaryKey,
LockModeType lockMode,
Map<String,Object> properties) |
<T> T |
find(Class<T> entityClass,
Object primaryKey,
Map<String,Object> properties) |
void |
flush()
Force this session to flush.
|
void |
flushBeforeTransactionCompletion() |
void |
forceFlush(EntityEntry e) |
EntityKey |
generateEntityKey(Serializable id,
EntityPersister persister)
Hide the changing requirements of entity key creation
|
<T> T |
get(Class<T> theClass,
Serializable id)
Return the persistent instance of the given entity class with the given identifier,
or null if there is no such persistent instance.
|
<T> T |
get(Class<T> theClass,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier,
or null if there is no such persistent instance.
|
<T> T |
get(Class<T> theClass,
Serializable id,
LockOptions lockOptions)
Return the persistent instance of the given entity class with the given identifier,
or null if there is no such persistent instance.
|
Object |
get(String entityName,
Serializable id)
Return the persistent instance of the given named entity with the given identifier,
or null if there is no such persistent instance.
|
Object |
get(String entityName,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier,
or null if there is no such persistent instance.
|
Object |
get(String entityName,
Serializable id,
LockOptions lockOptions)
Return the persistent instance of the given entity class with the given identifier,
or null if there is no such persistent instance.
|
ActionQueue |
getActionQueue() |
CacheMode |
getCacheMode()
Get the current cache mode.
|
CacheTransactionSynchronization |
getCacheTransactionSynchronization()
The current CacheTransactionContext associated with the Session.
|
Serializable |
getContextEntityIdentifier(Object object)
Return the identifier of the persistent object, or null if
not associated with the session
|
CriteriaBuilder |
getCriteriaBuilder() |
LockMode |
getCurrentLockMode(Object object)
Determine the current lock mode of the given object.
|
Object |
getDelegate()
This is an implementation of EntityManager#getDelegate().
|
int |
getDontFlushFromFind() |
Filter |
getEnabledFilter(String filterName)
Retrieve a currently enabled filter by name.
|
RootGraphImplementor<?> |
getEntityGraph(String graphName) |
<T> List<EntityGraph<? super T>> |
getEntityGraphs(Class<T> entityClass) |
EntityManagerFactory |
getEntityManagerFactory() |
String |
getEntityName(Object object)
Return the entity name for a persistent entity.
|
EntityPersister |
getEntityPersister(String entityName,
Object object)
Get the EntityPersister for any instance
|
Object |
getEntityUsingInterceptor(EntityKey key)
Get the entity instance associated with the given Key,
calling the Interceptor if necessary
|
SessionEventListenerManager |
getEventListenerManager() |
ExceptionConverter |
getExceptionConverter()
The converter associated to a Session might be lazily initialized: only invoke
this getter when there is actual need to use it.
|
SessionFactoryImplementor |
getFactory()
Get the creating SessionFactoryImplementor
|
FlushModeType |
getFlushMode()
For users of the Hibernate native APIs, we've had to rename this method
as defined by Hibernate historically because the JPA contract defines a method of the same
name, but returning the JPA
FlushModeType rather than Hibernate's FlushMode. |
FlushMode |
getHibernateFlushMode()
Get the current flush mode for this session.
|
Serializable |
getIdentifier(Object object)
Return the identifier value of the given entity as associated with this
session.
|
Interceptor |
getInterceptor()
Retrieves the interceptor currently in use by this event source.
|
Integer |
getJdbcBatchSize()
Get the Session-level JDBC batch size for the current Session.
|
JdbcConnectionAccess |
getJdbcConnectionAccess() |
JdbcCoordinator |
getJdbcCoordinator() |
JdbcServices |
getJdbcServices() |
JdbcSessionContext |
getJdbcSessionContext() |
TimeZone |
getJdbcTimeZone()
The JDBC
TimeZone used when persisting Timestamp and DateTime properties into the database. |
LoadQueryInfluencers |
getLoadQueryInfluencers()
Get the load query influencers associated with this session.
|
LobCreator |
getLobCreator()
Obtain access to the
LobCreator |
LobHelper |
getLobHelper()
Retrieve this session's helper/delegate for creating LOB instances.
|
LockModeType |
getLockMode(Object entity) |
LockOptions |
getLockRequest(LockModeType lockModeType,
Map<String,Object> properties)
Convert from JPA 2
LockModeType & properties into LockOptions |
Metamodel |
getMetamodel() |
NativeQueryImplementor |
getNamedNativeQuery(String name)
Get a NativeQuery instance for a named native SQL query
|
ProcedureCall |
getNamedProcedureCall(String name)
Gets a ProcedureCall based on a named template
|
QueryImplementor |
getNamedQuery(String name)
Create a
Query instance for the named query. |
NativeQueryImplementor |
getNamedSQLQuery(String name)
Get a NativeQuery instance for a named native SQL query
|
PersistenceContext |
getPersistenceContext()
Get the persistence context for this session.
|
PersistenceContext |
getPersistenceContextInternal()
This is similar to
SharedSessionContractImplementor.getPersistenceContext(), with
two main differences:
a) this version performs better as
it allows for inlining and probably better prediction
b) see SessionImplSharedSessionContractImplementor.getPersistenceContext() : it
does some checks on the current state of the Session. |
Map<String,Object> |
getProperties() |
<T> T |
getReference(Class<T> entityClass,
Object primaryKey) |
SessionImplementor |
getSession()
Retrieve a reference to the Hibernate
Session used by this EntityManager. |
SessionFactoryImplementor |
getSessionFactory()
Get the session factory which created this session.
|
UUID |
getSessionIdentifier()
A UUID associated with each Session.
|
SessionStatistics |
getStatistics()
Get the statistics for this session.
|
String |
getTenantIdentifier()
Obtain the tenant identifier associated with this session.
|
long |
getTimestamp() |
Transaction |
getTransaction()
Get the
Transaction instance associated with this session. |
TransactionCoordinator |
getTransactionCoordinator()
Obtain the builder for TransactionCoordinator instances
|
long |
getTransactionStartTimestamp()
A "timestamp" at or before the start of the current transaction.
|
TypeHelper |
getTypeHelper()
Convenience access to the
TypeHelper associated with this session's SessionFactory. |
String |
guessEntityName(Object entity)
The guessed entity name for an entity not in an association
|
Object |
immediateLoad(String entityName,
Serializable id)
Load an instance immediately.
|
void |
initializeCollection(PersistentCollection collection,
boolean writing)
Initialize the collection (if not already initialized)
|
Object |
instantiate(EntityPersister persister,
Serializable id) |
Object |
instantiate(String entityName,
Serializable id)
Instantiate the entity class, initializing with the given identifier
|
Object |
internalLoad(String entityName,
Serializable id,
boolean eager,
boolean nullable)
Load an instance without checking if it was deleted.
|
boolean |
isAutoCloseSessionEnabled() |
boolean |
isClosed()
Checks whether the session is closed.
|
boolean |
isConnected()
Check if the session is currently connected.
|
boolean |
isDefaultReadOnly()
Will entities and proxies that are loaded into this session be made
read-only by default?
To determine the read-only/modifiable setting for a particular entity
or proxy:
|
boolean |
isDirty()
Does this session contain any changes which must be synchronized with
the database? In other words, would any DML operations be executed if
we flushed this session?
|
boolean |
isEventSource() |
boolean |
isFetchProfileEnabled(String name)
Is a particular fetch profile enabled on this session?
|
boolean |
isFlushBeforeCompletionEnabled() |
boolean |
isJoinedToTransaction() |
boolean |
isOpen()
Check if the session is still open.
|
boolean |
isOpenOrWaitingForAutoClose()
Checks whether the session is open or is waiting for auto-close
|
boolean |
isQueryParametersValidationEnabled() |
boolean |
isReadOnly(Object entityOrProxy)
Is the specified entity or proxy read-only?
To get the default read-only/modifiable setting used for
entities and proxies that are loaded into the session:
|
boolean |
isTransactionInProgress()
Does this Session have an active Hibernate transaction
or is there a JTA transaction in progress?
|
Iterator |
iterate(String query,
QueryParameters queryParameters)
Execute an iterate() query
|
Iterator |
iterateFilter(Object collection,
String filter,
QueryParameters queryParameters)
Iterate a filter
|
void |
joinTransaction() |
List |
list(Criteria criteria)
Execute a criteria query
|
List |
list(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
Execute a native SQL query, and return the results as a fully built list.
|
List |
list(String query,
QueryParameters queryParameters)
Execute a find() query
|
List |
listCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
Execute an SQL Query
|
List |
listFilter(Object collection,
String filter,
QueryParameters queryParameters)
Execute a filter
|
<T> T |
load(Class<T> theClass,
Serializable id)
Return the persistent instance of the given entity class with the given identifier,
assuming that the instance exists.
|
<T> T |
load(Class<T> theClass,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
|
<T> T |
load(Class<T> theClass,
Serializable id,
LockOptions lockOptions)
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
|
void |
load(Object object,
Serializable id)
Read the persistent state associated with the given identifier into the given transient
instance.
|
Object |
load(String entityName,
Serializable id)
Return the persistent instance of the given entity class with the given identifier,
assuming that the instance exists.
|
Object |
load(String entityName,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
|
Object |
load(String entityName,
Serializable id,
LockOptions lockOptions)
Return the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
|
void |
lock(Object object,
LockMode lockMode)
Obtain the specified lock level upon the given object.
|
void |
lock(Object entity,
LockModeType lockMode) |
void |
lock(Object entity,
LockModeType lockMode,
Map<String,Object> properties) |
void |
lock(String entityName,
Object object,
LockMode lockMode)
Obtain the specified lock level upon the given object.
|
void |
markForRollbackOnly()
Marks current transaction (if one) for rollback only
|
Object |
merge(Object object)
Copy the state of the given object onto the persistent object with the same
identifier.
|
Object |
merge(String entityName,
Object object)
Copy the state of the given object onto the persistent object with the same
identifier.
|
void |
merge(String entityName,
Object object,
Map copiedAlready) |
void |
persist(Object object)
Make a transient instance persistent.
|
void |
persist(String entityName,
Object object)
Make a transient instance persistent.
|
void |
persist(String entityName,
Object object,
Map createdAlready) |
void |
persistOnFlush(String entityName,
Object object,
Map copiedAlready) |
void |
reconnect(Connection connection)
Reconnect to the given JDBC connection.
|
void |
refresh(Object object)
Re-read the state of the given instance from the underlying database.
|
void |
refresh(Object object,
LockMode lockMode)
Re-read the state of the given instance from the underlying database, with
the given LockMode.
|
void |
refresh(Object entity,
LockModeType lockMode) |
void |
refresh(Object entity,
LockModeType lockMode,
Map<String,Object> properties) |
void |
refresh(Object object,
LockOptions lockOptions)
Re-read the state of the given instance from the underlying database, with
the given LockMode.
|
void |
refresh(Object entity,
Map<String,Object> properties) |
void |
refresh(String entityName,
Object object)
Re-read the state of the given instance from the underlying database.
|
void |
refresh(String entityName,
Object object,
LockOptions lockOptions)
Re-read the state of the given instance from the underlying database, with
the given LockMode.
|
void |
refresh(String entityName,
Object object,
Map refreshedAlready) |
SqlTypeDescriptor |
remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)
Allow remapping of descriptors for dealing with sql type.
|
void |
remove(Object entity) |
void |
removeOrphanBeforeUpdates(String entityName,
Object child) |
void |
replicate(Object object,
ReplicationMode replicationMode)
Persist the state of the given detached instance, reusing the current
identifier value.
|
void |
replicate(String entityName,
Object object,
ReplicationMode replicationMode)
Persist the state of the given detached instance, reusing the current
identifier value.
|
Serializable |
save(Object object)
Persist the given transient instance, first assigning a generated identifier.
|
Serializable |
save(String entityName,
Object object)
Persist the given transient instance, first assigning a generated identifier.
|
void |
saveOrUpdate(Object object)
Either
Session.save(Object) or Session.update(Object) the given
instance, depending upon resolution of the unsaved-value checks (see the
manual for discussion of unsaved-value checking). |
void |
saveOrUpdate(String entityName,
Object object)
Either
Session.save(String, Object) or Session.update(String, Object)
the given instance, depending upon resolution of the unsaved-value checks
(see the manual for discussion of unsaved-value checking). |
ScrollableResultsImplementor |
scroll(Criteria criteria,
ScrollMode scrollMode)
Execute a criteria query
|
ScrollableResultsImplementor |
scroll(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
Execute a native SQL query, and return the results as a scrollable result.
|
ScrollableResultsImplementor |
scroll(String query,
QueryParameters queryParameters)
Execute a scroll() query
|
ScrollableResultsImplementor |
scrollCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
Execute an SQL Query
|
SharedSessionBuilder |
sessionWithOptions()
Obtain a
Session builder with the ability to grab certain information from this session. |
void |
setAutoClear(boolean enabled)
Enable/disable automatic cache clearing from after transaction
completion (for EJB3)
|
void |
setCacheMode(CacheMode cm)
Set the cache mode.
|
void |
setDefaultReadOnly(boolean readOnly)
Change the default for entities and proxies loaded into this session
from modifiable to read-only mode, or from modifiable to read-only mode.
|
void |
setFlushMode(FlushMode fm)
Set the flush mode for this session.
|
void |
setFlushMode(FlushModeType flushModeType) |
void |
setHibernateFlushMode(FlushMode flushMode)
Set the flush mode for this session.
|
void |
setJdbcBatchSize(Integer jdbcBatchSize)
Set the Session-level JDBC batch size.
|
void |
setProperty(String propertyName,
Object value) |
void |
setReadOnly(Object entityOrProxy,
boolean readOnly)
Set an unmodified persistent object to read-only mode, or a read-only
object to modifiable mode.
|
boolean |
shouldAutoClose() |
boolean |
shouldAutoJoinTransaction()
Indicates whether an active transaction should be automatically joined.
|
void |
startTransactionBoundary()
Callback indicating recognition of entering into a transactional
context whether that is explicitly via the Hibernate
Transaction API or via registration
of Hibernate's JTA Synchronization impl with a JTA Transaction |
<T> T |
unwrap(Class<T> cls) |
void |
update(Object object)
Update the persistent instance with the identifier of the given detached
instance.
|
void |
update(String entityName,
Object object)
Update the persistent instance with the identifier of the given detached
instance.
|
boolean |
useStreamForLobBinding()
Should streams be used for binding LOB values.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConfiguredJdbcBatchSize, isEnforcingFetchGraph, setEnforcingFetchGraphprotected final SessionImplementor delegate
@Deprecated public SessionDelegatorBaseImpl(SessionImplementor delegate, Session session)
SessionDelegatorBaseImpl(SessionImplementor) form insteadpublic SessionDelegatorBaseImpl(SessionImplementor delegate)
protected SessionImplementor delegate()
getDelegate()
method coming from the EntityManager interface which returns the current session.getDelegate()public <T> T execute(LobCreationContext.Callback<T> callback)
LobCreationContextConnection.execute in interface LobCreationContextT - The Java type of the type of LOB being created. One of Blob,
Clob, NClobcallback - The callback to execute .public String getTenantIdentifier()
SharedSessionContractgetTenantIdentifier in interface SharedSessionContractImplementorgetTenantIdentifier in interface SharedSessionContractnullpublic UUID getSessionIdentifier()
SharedSessionContractImplementorgetSessionIdentifier in interface SharedSessionContractImplementorpublic JdbcConnectionAccess getJdbcConnectionAccess()
getJdbcConnectionAccess in interface JdbcSessionOwnerpublic EntityKey generateEntityKey(Serializable id, EntityPersister persister)
SharedSessionContractImplementorgenerateEntityKey in interface SharedSessionContractImplementorid - The entity idpersister - The entity persisterpublic Interceptor getInterceptor()
SharedSessionContractImplementorgetInterceptor in interface SharedSessionContractImplementorpublic void setAutoClear(boolean enabled)
SharedSessionContractImplementorsetAutoClear in interface SharedSessionContractImplementorpublic boolean isTransactionInProgress()
SharedSessionContractImplementorisTransactionInProgress in interface SharedSessionContractImplementorisTransactionInProgress in interface HibernateEntityManagerImplementorpublic void checkTransactionNeededForUpdateOperation(String exceptionMessage)
SharedSessionContractImplementorcheckTransactionNeededForUpdateOperation in interface SharedSessionContractImplementorexceptionMessage - the message to use for the TransactionRequiredExceptionpublic LockOptions getLockRequest(LockModeType lockModeType, Map<String,Object> properties)
HibernateEntityManagerImplementorLockModeType & properties into LockOptionsgetLockRequest in interface HibernateEntityManagerImplementorlockModeType - is the requested lock typeproperties - are the lock propertiespublic LockOptions buildLockOptions(LockModeType lockModeType, Map<String,Object> properties)
HibernateEntityManagerImplementorLockModeType and properties, build a Hibernate
LockOptionsbuildLockOptions in interface HibernateEntityManagerImplementorlockModeType - the requested LockModeTypeproperties - the lock propertiespublic <T> QueryImplementor<T> createQuery(String jpaqlString, Class<T> resultClass, Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)
SessionImplementorcreateQuery in interface SessionImplementorcreateQuery in interface SharedSessionContractImplementorcreateQuery in interface HibernateEntityManagerImplementorT - The query typejpaqlString - 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.public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException
SharedSessionContractImplementorinitializeCollection in interface SharedSessionContractImplementorHibernateExceptionpublic Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException
SharedSessionContractImplementorinternalLoad in interface SharedSessionContractImplementorHibernateExceptionpublic Object immediateLoad(String entityName, Serializable id) throws HibernateException
SharedSessionContractImplementorimmediateLoad in interface SharedSessionContractImplementorHibernateExceptionpublic long getTimestamp()
getTimestamp in interface SharedSessionContractImplementorpublic SessionFactoryImplementor getFactory()
SharedSessionContractImplementorgetFactory in interface SharedSessionContractImplementorgetFactory in interface HibernateEntityManagerFactoryAwaregetFactory in interface QueryProducerImplementorpublic List list(String query, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorlist in interface SharedSessionContractImplementorHibernateExceptionpublic Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementoriterate in interface SharedSessionContractImplementorHibernateExceptionpublic ScrollableResultsImplementor scroll(String query, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorscroll in interface SharedSessionContractImplementorHibernateExceptionpublic ScrollableResultsImplementor scroll(Criteria criteria, ScrollMode scrollMode)
SharedSessionContractImplementorscroll in interface SharedSessionContractImplementorpublic List list(Criteria criteria)
SharedSessionContractImplementorlist in interface SharedSessionContractImplementorpublic List listFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorlistFilter in interface SharedSessionContractImplementorHibernateExceptionpublic Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementoriterateFilter in interface SharedSessionContractImplementorHibernateExceptionpublic EntityPersister getEntityPersister(String entityName, Object object) throws HibernateException
SharedSessionContractImplementorgetEntityPersister in interface SharedSessionContractImplementorentityName - optional entity nameobject - the entity instanceHibernateExceptionpublic Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
SharedSessionContractImplementorgetEntityUsingInterceptor in interface SharedSessionContractImplementorHibernateExceptionpublic Serializable getContextEntityIdentifier(Object object)
SharedSessionContractImplementorgetContextEntityIdentifier in interface SharedSessionContractImplementorpublic String bestGuessEntityName(Object object)
SharedSessionContractImplementorbestGuessEntityName in interface SharedSessionContractImplementorpublic String guessEntityName(Object entity) throws HibernateException
SharedSessionContractImplementorguessEntityName in interface SharedSessionContractImplementorHibernateExceptionpublic Object instantiate(String entityName, Serializable id) throws HibernateException
SharedSessionContractImplementorinstantiate in interface SharedSessionContractImplementorHibernateExceptionpublic List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorlistCustomQuery in interface SharedSessionContractImplementorHibernateExceptionpublic ScrollableResultsImplementor scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorscrollCustomQuery in interface SharedSessionContractImplementorHibernateExceptionpublic List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorlist in interface SharedSessionContractImplementorspec - The specification of the native SQL query to execute.queryParameters - The parameters by which to perform the execution.HibernateExceptionpublic ScrollableResultsImplementor scroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorscroll in interface SharedSessionContractImplementorspec - The specification of the native SQL query to execute.queryParameters - The parameters by which to perform the execution.HibernateExceptionpublic int getDontFlushFromFind()
getDontFlushFromFind in interface SharedSessionContractImplementorpublic PersistenceContext getPersistenceContext()
SharedSessionContractImplementorSharedSessionContractImplementor.getPersistenceContextInternal() for
an alternative.
This method is not extremely fast: if you need to access
the PersistenceContext multiple times, prefer keeping
a reference to it over invoking this method multiple times.getPersistenceContext in interface SharedSessionContractImplementorpublic int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorexecuteUpdate in interface SharedSessionContractImplementorHibernateExceptionpublic int executeNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorexecuteNativeUpdate in interface SharedSessionContractImplementorHibernateExceptionpublic CacheMode getCacheMode()
SessiongetCacheMode in interface SharedSessionContractImplementorgetCacheMode in interface QueryProducerImplementorgetCacheMode in interface Sessionpublic void setCacheMode(CacheMode cm)
SessionsetCacheMode in interface SharedSessionContractImplementorsetCacheMode in interface Sessioncm - The new cache mode.public boolean isOpen()
SharedSessionContractisOpen in interface EntityManagerisOpen in interface SharedSessionContractpublic boolean isConnected()
SharedSessionContractisConnected in interface SharedSessionContractpublic void checkOpen(boolean markForRollbackIfClosed)
SharedSessionContractImplementormarkForRollbackIfClosed is true, marks current transaction (if one) for rollback onlycheckOpen in interface SharedSessionContractImplementorcheckOpen in interface HibernateEntityManagerImplementormarkForRollbackIfClosed - If the EM is closed, should the transaction (if one) be marked for rollback?public void markForRollbackOnly()
SharedSessionContractImplementormarkForRollbackOnly in interface SharedSessionContractImplementormarkForRollbackOnly in interface HibernateEntityManagerImplementorpublic long getTransactionStartTimestamp()
SharedSessionContractImplementorgetTransactionStartTimestamp in interface SharedSessionContractImplementorpublic FlushModeType getFlushMode()
SessionFlushModeType rather than Hibernate's FlushMode. For
the former behavior, use Session.getHibernateFlushMode() instead.getFlushMode in interface EntityManagergetFlushMode in interface SharedSessionContractImplementorgetFlushMode in interface Sessionpublic void setFlushMode(FlushModeType flushModeType)
setFlushMode in interface EntityManagerpublic void setHibernateFlushMode(FlushMode flushMode)
SessionFlushMode.MANUAL at the start of the session (in
order to achieve some extra performance).setHibernateFlushMode in interface SharedSessionContractImplementorsetHibernateFlushMode in interface SessionflushMode - the new flush modepublic FlushMode getHibernateFlushMode()
SessiongetHibernateFlushMode in interface SharedSessionContractImplementorgetHibernateFlushMode in interface QueryProducerImplementorgetHibernateFlushMode in interface Sessionpublic void setFlushMode(FlushMode fm)
SessionFlushMode.MANUAL at the start of the session (in
order to achieve some extra performance).setFlushMode in interface SharedSessionContractImplementorsetFlushMode in interface Sessionfm - the new flush modepublic void lock(Object entity, LockModeType lockMode)
lock in interface EntityManagerpublic void lock(Object entity, LockModeType lockMode, Map<String,Object> properties)
lock in interface EntityManagerpublic Connection connection()
connection in interface SharedSessionContractImplementorpublic void flush()
SessionSession.setFlushMode(FlushMode),
EntityTransaction.commit() calls this method).
Flushing is the process of synchronizing the underlying persistent
store with persistable state held in memory.flush in interface EntityManagerflush in interface SharedSessionContractImplementorflush in interface Sessionpublic boolean isEventSource()
isEventSource in interface SharedSessionContractImplementorpublic void afterScrollOperation()
afterScrollOperation in interface SharedSessionContractImplementorpublic TransactionCoordinator getTransactionCoordinator()
JdbcSessionOwnergetTransactionCoordinator in interface JdbcSessionOwnerpublic JdbcCoordinator getJdbcCoordinator()
getJdbcCoordinator in interface SharedSessionContractImplementorpublic JdbcServices getJdbcServices()
getJdbcServices in interface SharedSessionContractImplementorpublic JdbcSessionContext getJdbcSessionContext()
getJdbcSessionContext in interface JdbcSessionOwnerpublic boolean isClosed()
SharedSessionContractImplementorSharedSessionContract.isOpen() as this method does not attempt any JTA synchronization
registration, whereas SharedSessionContract.isOpen() does; which makes this one
nicer to use for most internal purposes.isClosed in interface SharedSessionContractImplementortrue if the session is closed; false otherwise.public void checkOpen()
SharedSessionContractImplementorcheckOpen in interface SharedSessionContractImplementorpublic boolean isOpenOrWaitingForAutoClose()
SharedSessionContractImplementorisOpenOrWaitingForAutoClose in interface SharedSessionContractImplementortrue if the session is closed or if it's waiting for auto-close; false otherwise.public boolean shouldAutoClose()
shouldAutoClose in interface SharedSessionContractImplementorpublic boolean isAutoCloseSessionEnabled()
isAutoCloseSessionEnabled in interface SharedSessionContractImplementorpublic boolean isQueryParametersValidationEnabled()
isQueryParametersValidationEnabled in interface SharedSessionContractImplementorpublic boolean shouldAutoJoinTransaction()
TransactionCoordinatorBuilder.OptionsshouldAutoJoinTransaction in interface TransactionCoordinatorBuilder.Optionstrue indicates the active transaction should be auto joined; false
indicates it should not (until TransactionCoordinator.explicitJoin() is called).public LoadQueryInfluencers getLoadQueryInfluencers()
SharedSessionContractImplementorgetLoadQueryInfluencers in interface SharedSessionContractImplementorpublic ExceptionConverter getExceptionConverter()
SharedSessionContractImplementorgetExceptionConverter in interface SharedSessionContractImplementorpublic PersistenceContext getPersistenceContextInternal()
SharedSessionContractImplementorSharedSessionContractImplementor.getPersistenceContext(), with
two main differences:
a) this version performs better as
it allows for inlining and probably better prediction
b) see SessionImplSharedSessionContractImplementor.getPersistenceContext() : it
does some checks on the current state of the Session.
Choose wisely: performance is important, correctness comes first.getPersistenceContextInternal in interface SharedSessionContractImplementorpublic SessionEventListenerManager getEventListenerManager()
getEventListenerManager in interface SharedSessionContractImplementorpublic Transaction accessTransaction()
SharedSessionContractImplementoraccessTransaction in interface SharedSessionContractImplementorpublic Transaction beginTransaction()
SharedSessionContractTransaction object. If a new underlying transaction is
required, begin the transaction. Otherwise continue the new work in the context of the existing underlying
transaction.beginTransaction in interface SharedSessionContractSharedSessionContract.getTransaction()public Transaction getTransaction()
SharedSessionContractTransaction instance associated with this session. The concrete type of the returned
Transaction object is determined by the hibernate.transaction_factory property.getTransaction in interface EntityManagergetTransaction in interface SharedSessionContractpublic void startTransactionBoundary()
JdbcSessionOwnerTransaction API or via registration
of Hibernate's JTA Synchronization impl with a JTA TransactionstartTransactionBoundary in interface JdbcSessionOwnerpublic CacheTransactionSynchronization getCacheTransactionSynchronization()
SharedSessionContractImplementornull when the Session is not currently part of a transaction.getCacheTransactionSynchronization in interface SharedSessionContractImplementorpublic void afterTransactionBegin()
JdbcSessionOwnerafterTransactionBegin in interface JdbcSessionOwnerpublic void beforeTransactionCompletion()
JdbcSessionOwnerbeforeTransactionCompletion in interface JdbcSessionOwnerpublic void afterTransactionCompletion(boolean successful,
boolean delayed)
JdbcSessionOwnerafterTransactionCompletion in interface JdbcSessionOwnersuccessful - Was the transaction successful?delayed - Is this a delayed after transaction completion call (aka after a timeout)?public void flushBeforeTransactionCompletion()
flushBeforeTransactionCompletion in interface JdbcSessionOwnerpublic EntityManagerFactory getEntityManagerFactory()
getEntityManagerFactory in interface EntityManagerpublic CriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder in interface EntityManagerpublic Metamodel getMetamodel()
getMetamodel in interface EntityManagerpublic <T> RootGraphImplementor<T> createEntityGraph(Class<T> rootType)
createEntityGraph in interface EntityManagercreateEntityGraph in interface SessionImplementorcreateEntityGraph in interface Sessionpublic RootGraphImplementor<?> createEntityGraph(String graphName)
createEntityGraph in interface EntityManagercreateEntityGraph in interface SessionImplementorcreateEntityGraph in interface Sessionpublic RootGraphImplementor<?> getEntityGraph(String graphName)
getEntityGraph in interface EntityManagergetEntityGraph in interface SessionImplementorgetEntityGraph in interface Sessionpublic <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass)
getEntityGraphs in interface EntityManagergetEntityGraphs in interface Sessionpublic QueryImplementor getNamedQuery(String name)
QueryProducerQuery instance for the named query.getNamedQuery in interface SessionImplementorgetNamedQuery in interface QueryProducergetNamedQuery in interface QueryProducerImplementorgetNamedQuery in interface SharedSessionContractname - the name of a pre-defined, named querypublic NativeQueryImplementor getNamedSQLQuery(String name)
QueryProducergetNamedSQLQuery in interface SessionImplementorgetNamedSQLQuery in interface QueryProducergetNamedSQLQuery in interface QueryProducerImplementorname - The name of the pre-defined querypublic NativeQueryImplementor getNamedNativeQuery(String name)
QueryProducergetNamedNativeQuery in interface SessionImplementorgetNamedNativeQuery in interface QueryProducergetNamedNativeQuery in interface QueryProducerImplementorname - The name of the pre-defined querypublic QueryImplementor createQuery(String queryString)
QueryProducerQuery instance for the given HQL/JPQL query string.createQuery in interface EntityManagercreateQuery in interface SessionImplementorcreateQuery in interface QueryProducercreateQuery in interface QueryProducerImplementorcreateQuery in interface SharedSessionContractqueryString - The HQL/JPQL queryEntityManager.createQuery(String)public <T> QueryImplementor<T> createQuery(String queryString, Class<T> resultType)
QueryProducerQuery instance for the given HQL/JPQL query string.createQuery in interface EntityManagercreateQuery in interface SessionImplementorcreateQuery in interface QueryProducercreateQuery in interface QueryProducerImplementorcreateQuery in interface SessionqueryString - The HQL/JPQL queryEntityManager.createQuery(String,Class)public <T> QueryImplementor<T> createQuery(CriteriaQuery<T> criteriaQuery)
createQuery in interface EntityManagercreateQuery in interface SessionImplementorcreateQuery in interface QueryProducercreateQuery in interface Sessionpublic QueryImplementor createQuery(CriteriaUpdate updateQuery)
createQuery in interface EntityManagercreateQuery in interface SessionImplementorcreateQuery in interface QueryProducercreateQuery in interface Sessionpublic QueryImplementor createQuery(CriteriaDelete deleteQuery)
createQuery in interface EntityManagercreateQuery in interface SessionImplementorcreateQuery in interface QueryProducercreateQuery in interface Sessionpublic QueryImplementor createNamedQuery(String name)
QueryProducercreateNamedQuery in interface EntityManagercreateNamedQuery in interface SessionImplementorcreateNamedQuery in interface QueryProducercreateNamedQuery in interface QueryProducerImplementorname - the name of a pre-defined, named queryEntityManager.createNamedQuery(String)public <T> QueryImplementor<T> createNamedQuery(String name, Class<T> resultClass)
QueryProducercreateNamedQuery in interface EntityManagercreateNamedQuery in interface SessionImplementorcreateNamedQuery in interface QueryProducercreateNamedQuery in interface QueryProducerImplementorcreateNamedQuery in interface Sessionname - the name of a query defined in metadataresultClass - the type of the query resultEntityManager.createNamedQuery(String,Class)public NativeQueryImplementor createNativeQuery(String sqlString)
QueryProducercreateNativeQuery in interface EntityManagercreateNativeQuery in interface SessionImplementorcreateNativeQuery in interface QueryProducercreateNativeQuery in interface QueryProducerImplementorsqlString - a native SQL query stringEntityManager.createNativeQuery(String)public NativeQueryImplementor createNativeQuery(String sqlString, Class resultClass)
QueryProducercreateNativeQuery in interface EntityManagercreateNativeQuery in interface SessionImplementorcreateNativeQuery in interface QueryProducercreateNativeQuery in interface QueryProducerImplementorsqlString - Native (SQL) query stringresultClass - The Java type to map results toEntityManager.createNativeQuery(String,Class)public NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMapping)
QueryProducercreateNativeQuery in interface EntityManagercreateNativeQuery in interface SessionImplementorcreateNativeQuery in interface QueryProducercreateNativeQuery in interface QueryProducerImplementorsqlString - Native (SQL) query stringresultSetMapping - The explicit (named) result mappingEntityManager.createNativeQuery(String,Class),
SqlResultSetMappingpublic StoredProcedureQuery createNamedStoredProcedureQuery(String name)
createNamedStoredProcedureQuery in interface EntityManagerpublic StoredProcedureQuery createStoredProcedureQuery(String procedureName)
createStoredProcedureQuery in interface EntityManagerpublic StoredProcedureQuery createStoredProcedureQuery(String procedureName, Class... resultClasses)
createStoredProcedureQuery in interface EntityManagerpublic StoredProcedureQuery createStoredProcedureQuery(String procedureName, String... resultSetMappings)
createStoredProcedureQuery in interface EntityManagerpublic void joinTransaction()
joinTransaction in interface EntityManagerpublic boolean isJoinedToTransaction()
isJoinedToTransaction in interface EntityManagerpublic <T> T unwrap(Class<T> cls)
unwrap in interface EntityManagerpublic Object getDelegate()
To get the underlying delegate, use delegate() instead.
getDelegate in interface EntityManagerdelegate()public NativeQueryImplementor createSQLQuery(String queryString)
QueryProducerNativeQuery instance for the given SQL query string.createSQLQuery in interface SessionImplementorcreateSQLQuery in interface QueryProducercreateSQLQuery in interface QueryProducerImplementorcreateSQLQuery in interface SessionqueryString - The SQL querypublic ProcedureCall getNamedProcedureCall(String name)
SharedSessionContractgetNamedProcedureCall in interface SharedSessionContractname - The name given to the templateNamedStoredProcedureQuerypublic ProcedureCall createStoredProcedureCall(String procedureName)
SharedSessionContractcreateStoredProcedureCall in interface SharedSessionContractprocedureName - The name of the procedure.public ProcedureCall createStoredProcedureCall(String procedureName, Class... resultClasses)
SharedSessionContractcreateStoredProcedureCall in interface SharedSessionContractprocedureName - The name of the procedure.resultClasses - The entity(s) to map the result on to.public ProcedureCall createStoredProcedureCall(String procedureName, String... resultSetMappings)
SharedSessionContractcreateStoredProcedureCall in interface SharedSessionContractprocedureName - The name of the procedure.resultSetMappings - The explicit result set mapping(s) to use for mapping the resultspublic Criteria createCriteria(Class persistentClass)
SharedSessionContractCriteria instance for the given class (entity or subclasses/implementors).createCriteria in interface SharedSessionContractpersistentClass - The class, which is an entity, or has entity subclasses/implementorspublic Criteria createCriteria(Class persistentClass, String alias)
SharedSessionContractCriteria instance for the given class (entity or subclasses/implementors), using a specific
alias.createCriteria in interface SharedSessionContractpersistentClass - The class, which is an entity, or has entity subclasses/implementorsalias - The alias to usepublic Criteria createCriteria(String entityName)
SharedSessionContractCriteria instance for the given entity name.createCriteria in interface SharedSessionContractentityName - The entity namepublic Criteria createCriteria(String entityName, String alias)
SharedSessionContractCriteria instance for the given entity name, using a specific alias.createCriteria in interface SharedSessionContractentityName - The entity namealias - The alias to usepublic SharedSessionBuilder sessionWithOptions()
SessionSession builder with the ability to grab certain information from this session.sessionWithOptions in interface Sessionpublic SessionFactoryImplementor getSessionFactory()
SessiongetSessionFactory in interface SessionImplementorgetSessionFactory in interface SessionSessionFactorypublic void close()
throws HibernateException
SharedSessionContractclose in interface Closeableclose in interface AutoCloseableclose in interface EntityManagerclose in interface SharedSessionContractHibernateException - Indicates problems cleaning up.public void cancelQuery()
throws HibernateException
SessioncancelQuery in interface SessionHibernateException - There was a problem canceling the querypublic boolean isDirty()
throws HibernateException
SessionisDirty in interface SessionHibernateException - could not perform dirtying checkingpublic boolean isDefaultReadOnly()
SessionisDefaultReadOnly in interface SessionSession.isReadOnly(Object)public void setDefaultReadOnly(boolean readOnly)
SessionsetDefaultReadOnly in interface SessionreadOnly - true, the default for loaded entities/proxies is read-only;
false, the default for loaded entities/proxies is modifiableTo override this session's read-only/modifiable setting for entities
and proxies loaded by a Query:,
Query.setReadOnly(boolean)public Serializable getIdentifier(Object object)
SessiongetIdentifier in interface Sessionobject - a persistent instancepublic boolean contains(String entityName, Object object)
Sessionpublic boolean contains(Object object)
contains in interface EntityManagerpublic LockModeType getLockMode(Object entity)
getLockMode in interface EntityManagerpublic void setProperty(String propertyName, Object value)
setProperty in interface EntityManagerpublic Map<String,Object> getProperties()
getProperties in interface EntityManagerpublic void evict(Object object)
Sessionpublic <T> T load(Class<T> theClass, Serializable id, LockMode lockMode)
SessionSession.load(Class, Serializable, LockOptions)load in interface SessiontheClass - a persistent classid - a valid identifier of an existing persistent instance of the classlockMode - the lock levelSession.load(Class, Serializable, LockOptions)public <T> T load(Class<T> theClass, Serializable id, LockOptions lockOptions)
Sessionpublic Object load(String entityName, Serializable id, LockMode lockMode)
SessionSession.load(String, Serializable, LockOptions)load in interface SessionentityName - a persistent classid - a valid identifier of an existing persistent instance of the classlockMode - the lock levelSession.load(String, Serializable, LockOptions)public Object load(String entityName, Serializable id, LockOptions lockOptions)
Sessionpublic <T> T load(Class<T> theClass, Serializable id)
Sessionpublic Object load(String entityName, Serializable id)
Sessionpublic void load(Object object, Serializable id)
Sessionpublic void replicate(Object object, ReplicationMode replicationMode)
Sessioncascade="replicate"public void replicate(String entityName, Object object, ReplicationMode replicationMode)
Sessioncascade="replicate"public Serializable save(Object object)
Sessioncascade="save-update"public Serializable save(String entityName, Object object)
Sessioncascade="save-update"public void saveOrUpdate(Object object)
SessionSession.save(Object) or Session.update(Object) the given
instance, depending upon resolution of the unsaved-value checks (see the
manual for discussion of unsaved-value checking).
This operation cascades to associated instances if the association is mapped
with cascade="save-update"saveOrUpdate in interface Sessionobject - a transient or detached instance containing new or updated stateSession.save(java.lang.Object),
Session.update(Object object)public void saveOrUpdate(String entityName, Object object)
SessionSession.save(String, Object) or Session.update(String, Object)
the given instance, depending upon resolution of the unsaved-value checks
(see the manual for discussion of unsaved-value checking).
This operation cascades to associated instances if the association is mapped
with cascade="save-update"saveOrUpdate in interface SessionentityName - The entity nameobject - a transient or detached instance containing new or updated stateSession.save(String,Object),
Session.update(String,Object)public void update(Object object)
Sessioncascade="save-update"public void update(String entityName, Object object)
Sessioncascade="save-update"public Object merge(Object object)
Sessioncascade="merge"
The semantics of this method are defined by JSR-220.merge in interface EntityManagermerge in interface Sessionobject - a detached instance with state to be copiedpublic Object merge(String entityName, Object object)
Sessioncascade="merge"
The semantics of this method are defined by JSR-220.public void persist(Object object)
Sessioncascade="persist"
The semantics of this method are defined by JSR-220.persist in interface EntityManagerpersist in interface Sessionobject - a transient instance to be made persistentpublic void remove(Object entity)
remove in interface EntityManagerpublic <T> T find(Class<T> entityClass, Object primaryKey)
find in interface EntityManagerpublic <T> T find(Class<T> entityClass, Object primaryKey, Map<String,Object> properties)
find in interface EntityManagerpublic <T> T find(Class<T> entityClass, Object primaryKey, LockModeType lockMode)
find in interface EntityManagerpublic <T> T find(Class<T> entityClass, Object primaryKey, LockModeType lockMode, Map<String,Object> properties)
find in interface EntityManagerpublic <T> T getReference(Class<T> entityClass, Object primaryKey)
getReference in interface EntityManagerpublic void persist(String entityName, Object object)
Sessioncascade="persist"
The semantics of this method are defined by JSR-220.public void delete(Object object)
Sessioncascade="delete"public void delete(String entityName, Object object)
Sessioncascade="delete"public void lock(Object object, LockMode lockMode)
SessionSession.LockRequest.lock(Object) via Session.buildLockRequest(LockOptions)lock in interface Sessionobject - a persistent or transient instancelockMode - the lock levelSession.buildLockRequest(LockOptions),
Session.LockRequest.lock(Object)public void lock(String entityName, Object object, LockMode lockMode)
SessionSession.LockRequest.lock(String, Object) via Session.buildLockRequest(LockOptions)lock in interface SessionentityName - The name of the entityobject - a persistent or transient instancelockMode - the lock levelSession.buildLockRequest(LockOptions),
Session.LockRequest.lock(String, Object)public Session.LockRequest buildLockRequest(LockOptions lockOptions)
Sessionsession.buildLockRequest().setLockMode(LockMode.PESSIMISTIC_WRITE).setTimeOut(60000).lock(entity);buildLockRequest in interface SessionlockOptions - contains the lock levelpublic void refresh(Object object)
Sessionrefresh in interface EntityManagerrefresh in interface Sessionobject - a persistent or detached instancepublic void refresh(Object entity, Map<String,Object> properties)
refresh in interface EntityManagerpublic void refresh(Object entity, LockModeType lockMode)
refresh in interface EntityManagerpublic void refresh(Object entity, LockModeType lockMode, Map<String,Object> properties)
refresh in interface EntityManagerpublic void refresh(String entityName, Object object)
Sessionpublic void refresh(Object object, LockMode lockMode)
SessionSession.refresh(Object, LockOptions)refresh in interface Sessionobject - a persistent or detached instancelockMode - the lock mode to useSession.refresh(Object, LockOptions)public void refresh(Object object, LockOptions lockOptions)
Sessionpublic void refresh(String entityName, Object object, LockOptions lockOptions)
Sessionpublic LockMode getCurrentLockMode(Object object)
SessiongetCurrentLockMode in interface Sessionobject - a persistent instancepublic Query createFilter(Object collection, String queryString)
SessionQuery instance for the given collection and filter string. Contains an implicit FROM
element named this which refers to the defined table for the collection elements, as well as an implicit
WHERE restriction for this particular collection instance's key value.createFilter in interface Sessioncollection - a persistent collectionqueryString - a Hibernate query fragment.public void clear()
Sessionclear in interface EntityManagerclear in interface Sessionpublic void detach(Object entity)
detach in interface EntityManagerpublic <T> T get(Class<T> theClass, Serializable id)
Sessionpublic <T> T get(Class<T> theClass, Serializable id, LockMode lockMode)
SessionSession.get(Class, Serializable, LockOptions)get in interface SessiontheClass - The entity typeid - an identifierlockMode - the lock modeSession.get(Class, Serializable, LockOptions)public <T> T get(Class<T> theClass, Serializable id, LockOptions lockOptions)
Sessionpublic Object get(String entityName, Serializable id)
Sessionpublic Object get(String entityName, Serializable id, LockMode lockMode)
SessionSession.get(String, Serializable, LockOptions)get in interface SessionentityName - the entity nameid - an identifierlockMode - the lock modeSession.get(String, Serializable, LockOptions)public Object get(String entityName, Serializable id, LockOptions lockOptions)
Sessionpublic String getEntityName(Object object)
SessiongetEntityName in interface Sessionobject - a persistent entitypublic IdentifierLoadAccess byId(String entityName)
SessionIdentifierLoadAccess instance to retrieve the specified entity type by
primary key.public <T> MultiIdentifierLoadAccess<T> byMultipleIds(Class<T> entityClass)
SessionMultiIdentifierLoadAccess instance to retrieve multiple entities at once
as specified by primary key values.byMultipleIds in interface SessionentityClass - The entity type to be retrievedpublic MultiIdentifierLoadAccess byMultipleIds(String entityName)
SessionMultiIdentifierLoadAccess instance to retrieve multiple entities at once
as specified by primary key values.byMultipleIds in interface SessionentityName - The entity name of the entity type to be retrievedpublic <T> IdentifierLoadAccess<T> byId(Class<T> entityClass)
SessionIdentifierLoadAccess instance to retrieve the specified entity by
primary key.public NaturalIdLoadAccess byNaturalId(String entityName)
SessionNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.byNaturalId in interface SessionentityName - The entity name of the entity type to be retrievedpublic <T> NaturalIdLoadAccess<T> byNaturalId(Class<T> entityClass)
SessionNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.byNaturalId in interface SessionentityClass - The entity type to be retrievedpublic SimpleNaturalIdLoadAccess bySimpleNaturalId(String entityName)
SessionSimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.bySimpleNaturalId in interface SessionentityName - The entity name of the entity type to be retrievedpublic <T> SimpleNaturalIdLoadAccess<T> bySimpleNaturalId(Class<T> entityClass)
SessionSimpleNaturalIdLoadAccess instance to retrieve the specified entity by
its simple (single attribute) natural id.bySimpleNaturalId in interface SessionentityClass - The entity type to be retrievedpublic Filter enableFilter(String filterName)
SessionenableFilter in interface SessionfilterName - The name of the filter to be enabled.public Filter getEnabledFilter(String filterName)
SessiongetEnabledFilter in interface SessionfilterName - The name of the filter to be retrieved.public void disableFilter(String filterName)
SessiondisableFilter in interface SessionfilterName - The name of the filter to be disabled.public SessionStatistics getStatistics()
SessiongetStatistics in interface Sessionpublic boolean isReadOnly(Object entityOrProxy)
SessionisReadOnly in interface SessionentityOrProxy - an entity or HibernateProxytrue if the entity or proxy is read-only, false if the entity or proxy is modifiable.Session.isDefaultReadOnly()public void setReadOnly(Object entityOrProxy, boolean readOnly)
SessionsetReadOnly in interface SessionentityOrProxy - an entity or HibernateProxyreadOnly - true if the entity or proxy should be made read-only; false if the entity or
proxy should be made modifiableTo override this session's read-only/modifiable setting for entities
and proxies loaded by a Query:,
Query.setReadOnly(boolean)public void doWork(Work work) throws HibernateException
SharedSessionContractdoWork in interface SharedSessionContractwork - The work to be performed.HibernateException - Generally indicates wrapped SQLExceptionpublic <T> T doReturningWork(ReturningWork<T> work) throws HibernateException
SharedSessionContractReturningWork.execute(java.sql.Connection) call.doReturningWork in interface SharedSessionContractT - The type of the result returned from the workwork - The work to be performed.ReturningWork.execute(java.sql.Connection).HibernateException - Generally indicates wrapped SQLExceptionpublic Connection disconnect()
Sessiondisconnect in interface SessionnullSession.reconnect(Connection)public void reconnect(Connection connection)
Sessionreconnect in interface Sessionconnection - a JDBC connectionSession.disconnect()public boolean isFetchProfileEnabled(String name) throws UnknownProfileException
SessionisFetchProfileEnabled in interface Sessionname - The name of the profile to be checked.UnknownProfileException - Indicates that the given name does not
match any known profile namesfor discussion of this featurepublic void enableFetchProfile(String name) throws UnknownProfileException
SessionenableFetchProfile in interface Sessionname - The name of the fetch profile to be enabled.UnknownProfileException - Indicates that the given name does not
match any known profile namesfor discussion of this featurepublic void disableFetchProfile(String name) throws UnknownProfileException
SessiondisableFetchProfile in interface Sessionname - The name of the fetch profile to be disabled.UnknownProfileException - Indicates that the given name does not
match any known profile namesfor discussion of this featurepublic TypeHelper getTypeHelper()
SessionTypeHelper associated with this session's SessionFactory.
Equivalent to calling Session.getSessionFactory().getTypeHelper()getTypeHelper in interface SessionTypeHelper associated with this session's SessionFactorypublic LobHelper getLobHelper()
SessiongetLobHelper in interface Sessionpublic void addEventListeners(SessionEventListener... listeners)
SessionaddEventListeners in interface Sessionlisteners - The listener(s) to addpublic boolean isFlushBeforeCompletionEnabled()
isFlushBeforeCompletionEnabled in interface SessionImplementorpublic ActionQueue getActionQueue()
getActionQueue in interface SessionImplementorpublic Object instantiate(EntityPersister persister, Serializable id) throws HibernateException
instantiate in interface SessionImplementorHibernateExceptionpublic void forceFlush(EntityEntry e) throws HibernateException
forceFlush in interface SessionImplementorHibernateExceptionpublic void merge(String entityName, Object object, Map copiedAlready) throws HibernateException
merge in interface SessionImplementorHibernateExceptionpublic void persist(String entityName, Object object, Map createdAlready) throws HibernateException
persist in interface SessionImplementorHibernateExceptionpublic void persistOnFlush(String entityName, Object object, Map copiedAlready)
persistOnFlush in interface SessionImplementorpublic void refresh(String entityName, Object object, Map refreshedAlready) throws HibernateException
refresh in interface SessionImplementorHibernateExceptionpublic void delete(String entityName, Object child, boolean isCascadeDeleteEnabled, Set transientEntities)
delete in interface SessionImplementorpublic void removeOrphanBeforeUpdates(String entityName, Object child)
removeOrphanBeforeUpdates in interface SessionImplementorpublic SessionImplementor getSession()
HibernateEntityManagerSession used by this EntityManager.getSession in interface HibernateEntityManagergetSession in interface HibernateEntityManagerImplementorpublic boolean useStreamForLobBinding()
WrapperOptionsuseStreamForLobBinding in interface WrapperOptionstrue/falsepublic LobCreator getLobCreator()
WrapperOptionsLobCreatorgetLobCreator in interface WrapperOptionspublic SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)
WrapperOptionsremapSqlTypeDescriptor in interface WrapperOptionssqlTypeDescriptor - The known descriptorpublic Integer getJdbcBatchSize()
SharedSessionContracthibernate.default_batch_fetch_size configuration property for the scope of the current Session.getJdbcBatchSize in interface JdbcSessionOwnergetJdbcBatchSize in interface SharedSessionContractSessionFactoryOptions.getJdbcBatchSize(),
SessionFactoryBuilder.applyJdbcBatchSize(int)public void setJdbcBatchSize(Integer jdbcBatchSize)
SharedSessionContracthibernate.default_batch_fetch_size configuration property for the scope of the current Session.setJdbcBatchSize in interface SharedSessionContractjdbcBatchSize - Session-level JDBC batch sizeSessionFactoryOptions.getJdbcBatchSize(),
SessionFactoryBuilder.applyJdbcBatchSize(int)public TimeZone getJdbcTimeZone()
WrapperOptionsTimeZone used when persisting Timestamp and DateTime properties into the database.
This setting is used when storing timestamps using the PreparedStatement.setTimestamp(int, Timestamp, Calendar) method.
This way, the storage TimeZone can differ from the default JVM TimeZone given by TimeZone.getDefault().getJdbcTimeZone in interface WrapperOptionsTimeZoneCopyright © 2001-2022 Red Hat, Inc. All Rights Reserved.