public class SessionDelegatorBaseImpl extends Object implements SessionImplementor
This class is meant to be extended.
Wraps and delegates all methods to a 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:<ul>
<li>marks current transaction (if one) for rollback only</li>
<li>throws an IllegalStateException (JPA defines the exception type)</li>
</ul>
|
void |
checkOpen(boolean markForRollbackIfClosed)
Performs a check whether the Session is open, and if not:<ul>
<li>if
markForRollbackIfClosed is true, marks current transaction (if one) for rollback only</li>
<li>throws an IllegalStateException (JPA defines the exception type)</li>
</ul> |
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> EntityGraph<T> |
createEntityGraph(Class<T> rootType) |
EntityGraph<?> |
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.
|
EntityGraph<?> |
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 <tt>EntityPersister</tt> for any instance
|
Object |
getEntityUsingInterceptor(EntityKey key)
Get the entity instance associated with the given <tt>Key</tt>,
calling the Interceptor if necessary
|
SessionEventListenerManager |
getEventListenerManager() |
ExceptionConverter |
getExceptionConverter() |
SessionFactoryImplementor |
getFactory()
Get the creating <tt>SessionFactoryImplementor</tt>
|
FlushModeType |
getFlushMode()
<p/>
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
|
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?
|
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?
|
boolean |
isTransactionInProgress()
Does this <tt>Session</tt> have an active Hibernate transaction
or is there a JTA transaction in progress?
|
Iterator |
iterate(String query,
QueryParameters queryParameters)
Execute an <tt>iterate()</tt> 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 <tt>find()</tt> 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 <tt>LockMode</tt>.
|
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 <tt>LockMode</tt>.
|
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 <tt>LockMode</tt>.
|
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 <tt>scroll()</tt> 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, waitgetConfiguredJdbcBatchSizeprotected final SessionImplementor delegate
@Deprecated public SessionDelegatorBaseImpl(SessionImplementor delegate, Session session)
SessionDelegatorBaseImpl(SessionImplementor) form insteadpublic SessionDelegatorBaseImpl(SessionImplementor delegate)
protected SessionImplementor delegate()
Returns the underlying delegate. Be careful that is has a different behavior from the getDelegate()
method coming from the EntityManager interface which returns the current session.
getDelegate()public <T> T execute(LobCreationContext.Callback<T> callback)
LobCreationContextExecute the given callback, making sure it has access to a viable JDBC Connection.
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()
SharedSessionContractObtain the tenant identifier associated with this session.
getTenantIdentifier in interface SharedSessionContractImplementorgetTenantIdentifier in interface SharedSessionContractnullpublic UUID getSessionIdentifier()
SharedSessionContractImplementorA UUID associated with each Session. Useful mainly for logging.
getSessionIdentifier in interface SharedSessionContractImplementorpublic JdbcConnectionAccess getJdbcConnectionAccess()
getJdbcConnectionAccess in interface JdbcSessionOwnerpublic EntityKey generateEntityKey(Serializable id, EntityPersister persister)
SharedSessionContractImplementorHide the changing requirements of entity key creation
generateEntityKey in interface SharedSessionContractImplementorid - The entity idpersister - The entity persisterpublic Interceptor getInterceptor()
SharedSessionContractImplementorRetrieves the interceptor currently in use by this event source.
getInterceptor in interface SharedSessionContractImplementorpublic void setAutoClear(boolean enabled)
SharedSessionContractImplementorEnable/disable automatic cache clearing from after transaction completion (for EJB3)
setAutoClear in interface SharedSessionContractImplementorpublic boolean isTransactionInProgress()
SharedSessionContractImplementorDoes this <tt>Session</tt> have an active Hibernate transaction or is there a JTA transaction in progress?
isTransactionInProgress in interface SharedSessionContractImplementorisTransactionInProgress in interface HibernateEntityManagerImplementorpublic LockOptions getLockRequest(LockModeType lockModeType, Map<String,Object> properties)
HibernateEntityManagerImplementorConvert from JPA 2 LockModeType & properties into LockOptions
getLockRequest in interface HibernateEntityManagerImplementorlockModeType - is the requested lock typeproperties - are the lock propertiespublic LockOptions buildLockOptions(LockModeType lockModeType, Map<String,Object> properties)
HibernateEntityManagerImplementorGiven a JPA LockModeType and properties, build a Hibernate
LockOptions
buildLockOptions in interface HibernateEntityManagerImplementorlockModeType - the requested LockModeTypeproperties - the lock propertiespublic <T> QueryImplementor<T> createQuery(String jpaqlString, Class<T> resultClass, Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)
SessionImplementorUsed during "compiling" a JPA criteria query.
createQuery in interface SessionImplementorcreateQuery 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
SharedSessionContractImplementorInitialize the collection (if not already initialized)
initializeCollection in interface SharedSessionContractImplementorHibernateExceptionpublic Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException
SharedSessionContractImplementorLoad an instance without checking if it was deleted. <p/> When <tt>nullable</tt> is disabled this method may create a new proxy or return an existing proxy; if it does not exist, throw an exception. <p/> When <tt>nullable</tt> is enabled, the method does not create new proxies (but might return an existing proxy); if it does not exist, return <tt>null</tt>. <p/> When <tt>eager</tt> is enabled, the object is eagerly fetched
internalLoad in interface SharedSessionContractImplementorHibernateExceptionpublic Object immediateLoad(String entityName, Serializable id) throws HibernateException
SharedSessionContractImplementorLoad an instance immediately. This method is only called when lazily initializing a proxy. Do not return the proxy.
immediateLoad in interface SharedSessionContractImplementorHibernateExceptionpublic long getTimestamp()
getTimestamp in interface SharedSessionContractImplementorpublic SessionFactoryImplementor getFactory()
SharedSessionContractImplementorGet the creating <tt>SessionFactoryImplementor</tt>
getFactory in interface SharedSessionContractImplementorgetFactory in interface HibernateEntityManagerFactoryAwaregetFactory in interface QueryProducerImplementorpublic List list(String query, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute a <tt>find()</tt> query
list in interface SharedSessionContractImplementorHibernateExceptionpublic Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute an <tt>iterate()</tt> query
iterate in interface SharedSessionContractImplementorHibernateExceptionpublic ScrollableResultsImplementor scroll(String query, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute a <tt>scroll()</tt> query
scroll in interface SharedSessionContractImplementorHibernateExceptionpublic ScrollableResultsImplementor scroll(Criteria criteria, ScrollMode scrollMode)
SharedSessionContractImplementorExecute a criteria query
scroll in interface SharedSessionContractImplementorpublic List list(Criteria criteria)
SharedSessionContractImplementorExecute a criteria query
list in interface SharedSessionContractImplementorpublic List listFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute a filter
listFilter in interface SharedSessionContractImplementorHibernateExceptionpublic Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorIterate a filter
iterateFilter in interface SharedSessionContractImplementorHibernateExceptionpublic EntityPersister getEntityPersister(String entityName, Object object) throws HibernateException
SharedSessionContractImplementorGet the <tt>EntityPersister</tt> for any instance
getEntityPersister in interface SharedSessionContractImplementorentityName - optional entity nameobject - the entity instanceHibernateExceptionpublic Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
SharedSessionContractImplementorGet the entity instance associated with the given <tt>Key</tt>, calling the Interceptor if necessary
getEntityUsingInterceptor in interface SharedSessionContractImplementorHibernateExceptionpublic Serializable getContextEntityIdentifier(Object object)
SharedSessionContractImplementorReturn the identifier of the persistent object, or null if not associated with the session
getContextEntityIdentifier in interface SharedSessionContractImplementorpublic String bestGuessEntityName(Object object)
SharedSessionContractImplementorThe best guess entity name for an entity not in an association
bestGuessEntityName in interface SharedSessionContractImplementorpublic String guessEntityName(Object entity) throws HibernateException
SharedSessionContractImplementorThe guessed entity name for an entity not in an association
guessEntityName in interface SharedSessionContractImplementorHibernateExceptionpublic Object instantiate(String entityName, Serializable id) throws HibernateException
SharedSessionContractImplementorInstantiate the entity class, initializing with the given identifier
instantiate in interface SharedSessionContractImplementorHibernateExceptionpublic List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute an SQL Query
listCustomQuery in interface SharedSessionContractImplementorHibernateExceptionpublic ScrollableResultsImplementor scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute an SQL Query
scrollCustomQuery in interface SharedSessionContractImplementorHibernateExceptionpublic List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute a native SQL query, and return the results as a fully built list.
list 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
SharedSessionContractImplementorExecute a native SQL query, and return the results as a scrollable result.
scroll 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()
SharedSessionContractImplementorGet the persistence context for this session
getPersistenceContext in interface SharedSessionContractImplementorpublic int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute a HQL update or delete query
executeUpdate in interface SharedSessionContractImplementorHibernateExceptionpublic int executeNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters) throws HibernateException
SharedSessionContractImplementorExecute a native SQL update or delete query
executeNativeUpdate in interface SharedSessionContractImplementorHibernateExceptionpublic CacheMode getCacheMode()
SessionGet the current cache mode.
getCacheMode in interface SharedSessionContractImplementorgetCacheMode in interface QueryProducerImplementorgetCacheMode in interface Sessionpublic void setCacheMode(CacheMode cm)
SessionSet the cache mode. <p/> Cache mode determines the manner in which this session can interact with the second level cache.
setCacheMode in interface SharedSessionContractImplementorsetCacheMode in interface Sessioncm - The new cache mode.public boolean isOpen()
SharedSessionContractCheck if the session is still open.
isOpen in interface EntityManagerisOpen in interface SharedSessionContractpublic boolean isConnected()
SharedSessionContractCheck if the session is currently connected.
isConnected in interface SharedSessionContractpublic void checkOpen(boolean markForRollbackIfClosed)
SharedSessionContractImplementorPerforms a check whether the Session is open, and if not:<ul>
<li>if markForRollbackIfClosed is true, marks current transaction (if one) for rollback only</li>
<li>throws an IllegalStateException (JPA defines the exception type)</li>
</ul>
checkOpen in interface SharedSessionContractImplementorcheckOpen in interface HibernateEntityManagerImplementormarkForRollbackIfClosed - If the EM is closed, should the transaction (if one) be marked for rollback?public void markForRollbackOnly()
SharedSessionContractImplementorMarks current transaction (if one) for rollback only
markForRollbackOnly in interface SharedSessionContractImplementormarkForRollbackOnly in interface HibernateEntityManagerImplementorpublic long getTransactionStartTimestamp()
SharedSessionContractImplementorA "timestamp" at or before the start of the current transaction.
getTransactionStartTimestamp in interface SharedSessionContractImplementorpublic FlushModeType getFlushMode()
Session
<p/>
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. 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)
SessionSet the flush mode for this session.
<p/>
The flush mode determines the points at which the session is flushed.
<i>Flushing</i> is the process of synchronizing the underlying persistent
store with persistable state held in memory.
<p/>
For a logically "read only" session, it is reasonable to set the session’s
flush mode to FlushMode.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()
SessionGet the current flush mode for this session.
getHibernateFlushMode in interface SharedSessionContractImplementorgetHibernateFlushMode in interface QueryProducerImplementorgetHibernateFlushMode in interface Sessionpublic void setFlushMode(FlushMode fm)
SessionSet the flush mode for this session.
<p/>
The flush mode determines the points at which the session is flushed.
<i>Flushing</i> is the process of synchronizing the underlying persistent
store with persistable state held in memory.
<p/>
For a logically "read only" session, it is reasonable to set the session’s
flush mode to FlushMode.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()
SessionForce this session to flush. Must be called at the end of a
unit of work, before committing the transaction and closing the
session (depending on Session.setFlushMode(FlushMode),
EntityTransaction.commit() calls this method).
<p/>
<i>Flushing</i> 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()
JdbcSessionOwnerObtain the builder for TransactionCoordinator instances
getTransactionCoordinator in interface JdbcSessionOwnerpublic JdbcCoordinator getJdbcCoordinator()
getJdbcCoordinator in interface SharedSessionContractImplementorpublic JdbcServices getJdbcServices()
getJdbcServices in interface SharedSessionContractImplementorpublic JdbcSessionContext getJdbcSessionContext()
getJdbcSessionContext in interface JdbcSessionOwnerpublic boolean isClosed()
SharedSessionContractImplementorChecks whether the session is closed. Provided separately from
SharedSessionContract.isOpen() as this method does not attempt any JTA synchronization
registration, where as 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()
SharedSessionContractImplementorPerforms a check whether the Session is open, and if not:<ul> <li>marks current transaction (if one) for rollback only</li> <li>throws an IllegalStateException (JPA defines the exception type)</li> </ul>
checkOpen in interface SharedSessionContractImplementorpublic boolean isOpenOrWaitingForAutoClose()
SharedSessionContractImplementorChecks whether the session is open or is waiting for auto-close
isOpenOrWaitingForAutoClose 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.OptionsIndicates whether an active transaction should be automatically joined. Only relevant for JTA-based TransactionCoordinator instances.
shouldAutoJoinTransaction 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()
SharedSessionContractImplementorGet the load query influencers associated with this session.
getLoadQueryInfluencers in interface SharedSessionContractImplementorpublic ExceptionConverter getExceptionConverter()
getExceptionConverter in interface SharedSessionContractImplementorpublic SessionEventListenerManager getEventListenerManager()
getEventListenerManager in interface SharedSessionContractImplementorpublic Transaction accessTransaction()
SharedSessionContractImplementorProvides access to the underlying transaction or creates a new transaction if one does not already exist or is active. This is primarily for internal or integrator use.
accessTransaction in interface SharedSessionContractImplementorpublic Transaction beginTransaction()
SharedSessionContractBegin a unit of work and return the associated Transaction 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()
SharedSessionContractGet the Transaction 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()
JdbcSessionOwnerCallback 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
startTransactionBoundary in interface JdbcSessionOwnerpublic CacheTransactionSynchronization getCacheTransactionSynchronization()
SharedSessionContractImplementorThe current CacheTransactionContext associated with the Session. This may
return null when the Session is not currently part of a transaction.
getCacheTransactionSynchronization in interface SharedSessionContractImplementorpublic void afterTransactionBegin()
JdbcSessionOwnerA after-begin callback from the coordinator to its owner.
afterTransactionBegin in interface JdbcSessionOwnerpublic void beforeTransactionCompletion()
JdbcSessionOwnerA before-completion callback to the owner.
beforeTransactionCompletion in interface JdbcSessionOwnerpublic void afterTransactionCompletion(boolean successful,
boolean delayed)
JdbcSessionOwnerAn after-completion callback to the owner.
afterTransactionCompletion 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> EntityGraph<T> createEntityGraph(Class<T> rootType)
createEntityGraph in interface EntityManagerpublic EntityGraph<?> createEntityGraph(String graphName)
createEntityGraph in interface EntityManagerpublic EntityGraph<?> getEntityGraph(String graphName)
getEntityGraph in interface EntityManagerpublic <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass)
getEntityGraphs in interface EntityManagerpublic QueryImplementor getNamedQuery(String name)
QueryProducerCreate a Query instance for the named query.
getNamedQuery in interface SessionImplementorgetNamedQuery in interface QueryProducergetNamedQuery in interface QueryProducerImplementorgetNamedQuery in interface Sessionname - the name of a pre-defined, named querypublic NativeQueryImplementor getNamedSQLQuery(String name)
QueryProducerGet a NativeQuery instance for a named native SQL query
getNamedSQLQuery in interface SessionImplementorgetNamedSQLQuery in interface QueryProducergetNamedSQLQuery in interface QueryProducerImplementorname - The name of the pre-defined querypublic NativeQueryImplementor getNamedNativeQuery(String name)
QueryProducerGet a NativeQuery instance for a named native SQL query
getNamedNativeQuery in interface SessionImplementorgetNamedNativeQuery in interface QueryProducergetNamedNativeQuery in interface QueryProducerImplementorname - The name of the pre-defined querypublic QueryImplementor createQuery(String queryString)
QueryProducerCreate a Query 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)public <T> QueryImplementor<T> createQuery(String queryString, Class<T> resultType)
QueryProducerCreate a typed Query 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 Sessionpublic QueryImplementor createQuery(CriteriaUpdate updateQuery)
createQuery in interface EntityManagercreateQuery in interface SessionImplementorcreateQuery in interface Sessionpublic QueryImplementor createQuery(CriteriaDelete deleteQuery)
createQuery in interface EntityManagercreateQuery in interface SessionImplementorcreateQuery in interface Sessionpublic QueryImplementor createNamedQuery(String name)
QueryProducerThe JPA-defined named query creation method. This form can represent an HQL/JPQL query or a native query.
createNamedQuery 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)
QueryProducerThe JPA-defined named, typed query creation method. This form can only represent an HQL/JPQL query (not a native query).
createNamedQuery 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)
QueryProducerCreate a NativeQuery instance for the given native (SQL) query
createNativeQuery 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)
QueryProducerCreate a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.
createNativeQuery 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)
QueryProducerCreate a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.
createNativeQuery 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()
This is an implementation of EntityManager#getDelegate(). It returns the current session and not the delegate
session as it is what we want. The name of the method is misleading here but, as it is part of JPA, we cannot do
anything about it.
<p>
To get the underlying delegate, use delegate() instead.
getDelegate in interface EntityManagerdelegate()public NativeQueryImplementor createSQLQuery(String queryString)
QueryProducerCreate a NativeQuery 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)
SharedSessionContractGets a ProcedureCall based on a named template
getNamedProcedureCall in interface SharedSessionContractname - The name given to the templateNamedStoredProcedureQuerypublic ProcedureCall createStoredProcedureCall(String procedureName)
SharedSessionContractCreates a call to a stored procedure.
createStoredProcedureCall in interface SharedSessionContractprocedureName - The name of the procedure.public ProcedureCall createStoredProcedureCall(String procedureName, Class... resultClasses)
SharedSessionContractCreates a call to a stored procedure with specific result set entity mappings. Each class named is considered a "root return".
createStoredProcedureCall 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)
SharedSessionContractCreates a call to a stored procedure with specific result set entity mappings.
createStoredProcedureCall 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)
SharedSessionContractCreate Criteria 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)
SharedSessionContractCreate Criteria 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)
SharedSessionContractCreate Criteria instance for the given entity name.
createCriteria in interface SharedSessionContractentityName - The entity namepublic Criteria createCriteria(String entityName, String alias)
SharedSessionContractCreate Criteria instance for the given entity name, using a specific alias.
createCriteria in interface SharedSessionContractentityName - The entity namealias - The alias to usepublic SharedSessionBuilder sessionWithOptions()
SessionObtain a Session builder with the ability to grab certain information from this session.
sessionWithOptions in interface Sessionpublic SessionFactoryImplementor getSessionFactory()
SessionGet the session factory which created this session.
getSessionFactory in interface SessionImplementorgetSessionFactory in interface SessionSessionFactorypublic void close()
throws HibernateException
SharedSessionContractEnd the session by releasing the JDBC connection and cleaning up.
close in interface Closeableclose in interface AutoCloseableclose in interface EntityManagerclose in interface SharedSessionContractHibernateException - Indicates problems cleaning up.public void cancelQuery()
throws HibernateException
SessionCancel the execution of the current query. <p/> This is the sole method on session which may be safely called from another thread.
cancelQuery in interface SessionHibernateException - There was a problem canceling the querypublic boolean isDirty()
throws HibernateException
SessionDoes 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?
isDirty in interface SessionHibernateException - could not perform dirtying checkingpublic boolean isDefaultReadOnly()
SessionWill 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:
isDefaultReadOnly in interface SessionSession.isReadOnly(Object)public void setDefaultReadOnly(boolean readOnly)
SessionChange the default for entities and proxies loaded into this session from modifiable to read-only mode, or from modifiable to read-only mode.
Read-only entities are not dirty-checked and snapshots of persistent state are not maintained. Read-only entities can be modified, but changes are not persisted.
When a proxy is initialized, the loaded entity will have the same read-only/modifiable setting as the uninitialized proxy has, regardless of the session’s current setting.
To change the read-only/modifiable setting for a particular entity or proxy that is already in this session:
setDefaultReadOnly in interface SessionreadOnly - true, the default for loaded entities/proxies is read-only;
false, the default for loaded entities/proxies is modifiableSession.setReadOnly(Object,boolean),
Query.setReadOnly(boolean)public Serializable getIdentifier(Object object)
SessionReturn the identifier value of the given entity as associated with this session. An exception is thrown if the given entity instance is transient or detached in relation to this session.
getIdentifier in interface Sessionobject - a persistent instancepublic boolean contains(String entityName, Object object)
SessionCheck if this entity is associated with this Session. This form caters to non-POJO entities, by allowing the entity-name to be passed in
public 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)
SessionRemove this instance from the session cache. Changes to the instance will not be synchronized with the database. This operation cascades to associated instances if the association is mapped with <tt>cascade="evict"</tt>.
public <T> T load(Class<T> theClass, Serializable id, LockMode lockMode)
SessionReturn the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
<p/>
Convenient form of Session.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)
SessionReturn 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 entityName, Serializable id, LockMode lockMode)
SessionReturn the persistent instance of the given entity class with the given identifier,
obtaining the specified lock mode, assuming the instance exists.
<p/>
Convenient form of Session.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)
SessionReturn 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> theClass, Serializable id)
SessionReturn the persistent instance of the given entity class with the given identifier, assuming that the instance exists. This method might return a proxied instance that is initialized on-demand, when a non-identifier method is accessed. <br><br> You should not use this method to determine if an instance exists (use <tt>get()</tt> instead). Use this only to retrieve an instance that you assume exists, where non-existence would be an actual error.
public Object load(String entityName, Serializable id)
SessionReturn the persistent instance of the given entity class with the given identifier, assuming that the instance exists. This method might return a proxied instance that is initialized on-demand, when a non-identifier method is accessed. <br><br> You should not use this method to determine if an instance exists (use <tt>get()</tt> instead). Use this only to retrieve an instance that you assume exists, where non-existence would be an actual error.
public void load(Object object, Serializable id)
SessionRead the persistent state associated with the given identifier into the given transient instance.
public void replicate(Object object, ReplicationMode replicationMode)
SessionPersist the state of the given detached instance, reusing the current
identifier value. This operation cascades to associated instances if
the association is mapped with cascade="replicate"
public void replicate(String entityName, Object object, ReplicationMode replicationMode)
SessionPersist the state of the given detached instance, reusing the current
identifier value. This operation cascades to associated instances if
the association is mapped with cascade="replicate"
public Serializable save(Object object)
SessionPersist the given transient instance, first assigning a generated identifier. (Or
using the current value of the identifier property if the <tt>assigned</tt>
generator is used.) This operation cascades to associated instances if the
association is mapped with cascade="save-update"
public Serializable save(String entityName, Object object)
SessionPersist the given transient instance, first assigning a generated identifier. (Or
using the current value of the identifier property if the <tt>assigned</tt>
generator is used.) This operation cascades to associated instances if the
association is mapped with cascade="save-update"
public void saveOrUpdate(Object object)
SessionEither 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).
<p/>
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)
SessionEither 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).
<p/>
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)
SessionUpdate the persistent instance with the identifier of the given detached
instance. If there is a persistent instance with the same identifier,
an exception is thrown. This operation cascades to associated instances
if the association is mapped with cascade="save-update"
public void update(String entityName, Object object)
SessionUpdate the persistent instance with the identifier of the given detached
instance. If there is a persistent instance with the same identifier,
an exception is thrown. This operation cascades to associated instances
if the association is mapped with cascade="save-update"
public Object merge(Object object)
SessionCopy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved, save a copy of and return it as a newly persistent
instance. The given instance does not become associated with the session.
This operation cascades to associated instances if the association is mapped
with cascade="merge"
<p/>
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)
SessionCopy the state of the given object onto the persistent object with the same
identifier. If there is no persistent instance currently associated with
the session, it will be loaded. Return the persistent instance. If the
given instance is unsaved, save a copy of and return it as a newly persistent
instance. The given instance does not become associated with the session.
This operation cascades to associated instances if the association is mapped
with cascade="merge"
<p/>
The semantics of this method are defined by JSR-220.
public void persist(Object object)
SessionMake a transient instance persistent. This operation cascades to associated
instances if the association is mapped with cascade="persist"
<p/>
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)
SessionMake a transient instance persistent. This operation cascades to associated
instances if the association is mapped with cascade="persist"
<p/>
The semantics of this method are defined by JSR-220.
public void delete(Object object)
SessionRemove a persistent instance from the datastore. The argument may be
an instance associated with the receiving <tt>Session</tt> or a transient
instance with an identifier associated with existing persistent state.
This operation cascades to associated instances if the association is mapped
with cascade="delete"
public void delete(String entityName, Object object)
SessionRemove a persistent instance from the datastore. The <b>object</b> argument may be
an instance associated with the receiving <tt>Session</tt> or a transient
instance with an identifier associated with existing persistent state.
This operation cascades to associated instances if the association is mapped
with cascade="delete"
public void lock(Object object, LockMode lockMode)
SessionObtain the specified lock level upon the given object. This may be used to
perform a version check (<tt>LockMode.READ</tt>), to upgrade to a pessimistic
lock (<tt>LockMode.PESSIMISTIC_WRITE</tt>), or to simply reassociate a transient instance
with a session (<tt>LockMode.NONE</tt>). This operation cascades to associated
instances if the association is mapped with <tt>cascade="lock"</tt>.
<p/>
Convenient form of Session.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)
SessionObtain the specified lock level upon the given object. This may be used to
perform a version check (<tt>LockMode.OPTIMISTIC</tt>), to upgrade to a pessimistic
lock (<tt>LockMode.PESSIMISTIC_WRITE</tt>), or to simply reassociate a transient instance
with a session (<tt>LockMode.NONE</tt>). This operation cascades to associated
instances if the association is mapped with <tt>cascade="lock"</tt>.
<p/>
Convenient form of Session.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)
SessionBuild a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope.
timeout and scope is ignored for optimistic locking. After building the LockRequest,
call LockRequest.lock to perform the requested locking.
<p/>
Example usage:
session.buildLockRequest().setLockMode(LockMode.PESSIMISTIC_WRITE).setTimeOut(60000).lock(entity);
buildLockRequest in interface SessionlockOptions - contains the lock levelpublic void refresh(Object object)
SessionRe-read the state of the given instance from the underlying database. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances. For example <ul> <li>where a database trigger alters the object state upon insert or update <li>after executing direct SQL (eg. a mass update) in the same session <li>after inserting a <tt>Blob</tt> or <tt>Clob</tt> </ul>
refresh 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)
SessionRe-read the state of the given instance from the underlying database. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances. For example <ul> <li>where a database trigger alters the object state upon insert or update <li>after executing direct SQL (eg. a mass update) in the same session <li>after inserting a <tt>Blob</tt> or <tt>Clob</tt> </ul>
public void refresh(Object object, LockMode lockMode)
SessionRe-read the state of the given instance from the underlying database, with
the given <tt>LockMode</tt>. It is inadvisable to use this to implement
long-running sessions that span many business tasks. This method is, however,
useful in certain special circumstances.
<p/>
Convenient form of Session.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)
SessionRe-read the state of the given instance from the underlying database, with the given <tt>LockMode</tt>. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances.
public void refresh(String entityName, Object object, LockOptions lockOptions)
SessionRe-read the state of the given instance from the underlying database, with the given <tt>LockMode</tt>. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances.
public LockMode getCurrentLockMode(Object object)
SessionDetermine the current lock mode of the given object.
getCurrentLockMode in interface Sessionobject - a persistent instancepublic Query createFilter(Object collection, String queryString)
SessionCreate a Query 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()
SessionCompletely clear the session. Evict all loaded instances and cancel all pending saves, updates and deletions. Do not close open iterators or instances of <tt>ScrollableResults</tt>.
clear in interface EntityManagerclear in interface Sessionpublic void detach(Object entity)
detach in interface EntityManagerpublic <T> T get(Class<T> theClass, Serializable id)
SessionReturn the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.)
public <T> T get(Class<T> theClass, Serializable id, LockMode lockMode)
SessionReturn the persistent instance of the given entity class with the given identifier,
or null if there is no such persistent instance. (If the instance is already associated
with the session, return that instance. This method never returns an uninitialized instance.)
Obtain the specified lock mode if the instance exists.
<p/>
Convenient form of Session.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)
SessionReturn the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.) Obtain the specified lock mode if the instance exists.
public Object get(String entityName, Serializable id)
SessionReturn the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.)
public Object get(String entityName, Serializable id, LockMode lockMode)
SessionReturn the persistent instance of the given entity class with the given identifier,
or null if there is no such persistent instance. (If the instance is already associated
with the session, return that instance. This method never returns an uninitialized instance.)
Obtain the specified lock mode if the instance exists.
<p/>
Convenient form of Session.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)
SessionReturn the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.) Obtain the specified lock mode if the instance exists.
public String getEntityName(Object object)
SessionReturn the entity name for a persistent entity.
getEntityName in interface Sessionobject - a persistent entitypublic IdentifierLoadAccess byId(String entityName)
SessionCreate an IdentifierLoadAccess instance to retrieve the specified entity type by
primary key.
public <T> MultiIdentifierLoadAccess<T> byMultipleIds(Class<T> entityClass)
SessionCreate a MultiIdentifierLoadAccess 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)
SessionCreate a MultiIdentifierLoadAccess 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)
SessionCreate an IdentifierLoadAccess instance to retrieve the specified entity by
primary key.
public NaturalIdLoadAccess byNaturalId(String entityName)
SessionCreate a NaturalIdLoadAccess 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)
SessionCreate a NaturalIdLoadAccess instance to retrieve the specified entity by
its natural id.
byNaturalId in interface SessionentityClass - The entity type to be retrievedpublic SimpleNaturalIdLoadAccess bySimpleNaturalId(String entityName)
SessionCreate a SimpleNaturalIdLoadAccess 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)
SessionCreate a SimpleNaturalIdLoadAccess 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)
SessionEnable the named filter for this current session.
enableFilter in interface SessionfilterName - The name of the filter to be enabled.public Filter getEnabledFilter(String filterName)
SessionRetrieve a currently enabled filter by name.
getEnabledFilter in interface SessionfilterName - The name of the filter to be retrieved.public void disableFilter(String filterName)
SessionDisable the named filter for the current session.
disableFilter in interface SessionfilterName - The name of the filter to be disabled.public SessionStatistics getStatistics()
SessionGet the statistics for this session.
getStatistics in interface Sessionpublic boolean isReadOnly(Object entityOrProxy)
SessionIs 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:
isReadOnly 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)
SessionSet an unmodified persistent object to read-only mode, or a read-only object to modifiable mode. In read-only mode, no snapshot is maintained, the instance is never dirty checked, and changes are not persisted.
If the entity or proxy already has the specified read-only/modifiable setting, then this method does nothing.
To set the default read-only/modifiable setting used for entities and proxies that are loaded into the session:
setReadOnly 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 modifiableSession.setDefaultReadOnly(boolean),
Query.setReadOnly(boolean)public void doWork(Work work) throws HibernateException
SessionController for allowing users to perform JDBC related work using the Connection managed by this Session.
doWork in interface Sessionwork - The work to be performed.HibernateException - Generally indicates wrapped SQLExceptionpublic <T> T doReturningWork(ReturningWork<T> work) throws HibernateException
SessionController for allowing users to perform JDBC related work using the Connection managed by this Session. After
execution returns the result of the ReturningWork.execute(java.sql.Connection) call.
doReturningWork in interface SessionT - 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 the session from its underlying JDBC connection. This is intended for use in cases where the application has supplied the JDBC connection to the session and which require long-sessions (aka, conversations). <p/> It is considered an error to call this method on a session which was not opened by supplying the JDBC connection and an exception will be thrown. <p/> For non-user-supplied scenarios, normal transaction management already handles disconnection and reconnection automatically.
disconnect in interface SessionnullSession.reconnect(Connection)public void reconnect(Connection connection)
SessionReconnect to the given JDBC connection.
reconnect in interface Sessionconnection - a JDBC connectionSession.disconnect()public boolean isFetchProfileEnabled(String name) throws UnknownProfileException
SessionIs a particular fetch profile enabled on this session?
isFetchProfileEnabled 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
SessionEnable a particular fetch profile on this session. No-op if requested profile is already enabled.
enableFetchProfile 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
SessionDisable a particular fetch profile on this session. No-op if requested profile is already disabled.
disableFetchProfile 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()
SessionConvenience access to the TypeHelper associated with this session’s SessionFactory.
<p/>
Equivalent to calling Session.getSessionFactory().getTypeHelper()
getTypeHelper in interface SessionTypeHelper associated with this session’s SessionFactorypublic LobHelper getLobHelper()
SessionRetrieve this session’s helper/delegate for creating LOB instances.
getLobHelper in interface Sessionpublic void addEventListeners(SessionEventListener... listeners)
SessionAdd one or more listeners to the Session
addEventListeners 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()
HibernateEntityManagerRetrieve a reference to the Hibernate Session used by this EntityManager.
getSession in interface HibernateEntityManagergetSession in interface HibernateEntityManagerImplementorpublic boolean useStreamForLobBinding()
WrapperOptionsShould streams be used for binding LOB values.
useStreamForLobBinding in interface WrapperOptionstrue/falsepublic LobCreator getLobCreator()
WrapperOptionsObtain access to the LobCreator
getLobCreator in interface WrapperOptionspublic SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)
WrapperOptionsAllow remapping of descriptors for dealing with sql type.
remapSqlTypeDescriptor in interface WrapperOptionssqlTypeDescriptor - The known descriptorpublic Integer getJdbcBatchSize()
SharedSessionContractGet the Session-level JDBC batch size for the current Session.
Overrides the SessionFactory JDBC batch size defined by the hibernate.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)
SharedSessionContractSet the Session-level JDBC batch size.
Overrides the SessionFactory JDBC batch size defined by the hibernate.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()
WrapperOptionsThe JDBC TimeZone 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-2018 Red Hat, Inc. All Rights Reserved.