public class StatelessSessionImpl extends AbstractSessionImpl implements StatelessSession
AbstractSessionImpl.JdbcObserverImpl, AbstractSessionImpl.JdbcSessionContextImplLobCreationContext.Callback<T>currentHibernateTransaction, factory, wrapperOptions| Modifier and Type | Method and Description |
|---|---|
void |
afterOperation(boolean success) |
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
|
void |
close()
Close the stateless session and release the JDBC connection.
|
Connection |
connection()
Returns the current JDBC connection associated with this
instance.
If the session is using aggressive connection release (as in a CMT environment), it is the application's responsibility to close the connection returned by this call. |
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. |
void |
delete(Object entity)
Delete a row.
|
void |
delete(String entityName,
Object entity)
Delete a row.
|
void |
disableTransactionAutoJoin()
Disable automatic transaction joining.
|
int |
executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification,
QueryParameters queryParameters)
Execute a native SQL update or delete query
|
int |
executeUpdate(String query,
QueryParameters queryParameters)
Execute a HQL update or delete query
|
void |
flush() |
void |
flushBeforeTransactionCompletion() |
Object |
get(Class entityClass,
Serializable id)
Retrieve a row.
|
Object |
get(Class entityClass,
Serializable id,
LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.
|
Object |
get(String entityName,
Serializable id)
Retrieve a row.
|
Object |
get(String entityName,
Serializable id,
LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.
|
CacheMode |
getCacheMode() |
Serializable |
getContextEntityIdentifier(Object object)
Return the identifier of the persistent object, or null if
not associated with the session
|
int |
getDontFlushFromFind() |
EntityMode |
getEntityMode() |
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() |
FlushMode |
getFlushMode() |
Interceptor |
getInterceptor()
Retrieves the interceptor currently in use by this event source.
|
JdbcCoordinator |
getJdbcCoordinator() |
JdbcSessionContext |
getJdbcSessionContext() |
LoadQueryInfluencers |
getLoadQueryInfluencers()
Get the load query influencers associated with this session.
|
PersistenceContext |
getPersistenceContext()
Get the persistence context for this session
|
long |
getTimestamp()
System time before the start of the transaction
|
TransactionCoordinator |
getTransactionCoordinator()
Retrieve access to the session's transaction coordinator.
|
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)
|
Serializable |
insert(Object entity)
Insert a row.
|
Serializable |
insert(String entityName,
Object entity)
Insert a row.
|
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 |
isConnected() |
boolean |
isDefaultReadOnly() |
boolean |
isEventSource() |
boolean |
isOpen() |
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
|
List |
list(Criteria criteria)
Execute a criteria query
|
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
|
void |
refresh(Object entity)
Refresh the entity instance state from the database.
|
void |
refresh(Object entity,
LockMode lockMode)
Refresh the entity instance state from the database.
|
void |
refresh(String entityName,
Object entity)
Refresh the entity instance state from the database.
|
void |
refresh(String entityName,
Object entity,
LockMode lockMode)
Refresh the entity instance state from the database.
|
ScrollableResults |
scroll(Criteria criteria,
ScrollMode scrollMode)
Execute a criteria query
|
ScrollableResults |
scroll(String query,
QueryParameters queryParameters)
Execute a scroll() query
|
ScrollableResults |
scrollCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
Execute an SQL Query
|
void |
setAutoClear(boolean enabled)
Enable/disable automatic cache clearing from after transaction
completion (for EJB3)
|
void |
setCacheMode(CacheMode cm) |
void |
setDefaultReadOnly(boolean readOnly) |
void |
setFlushMode(FlushMode fm) |
boolean |
shouldAutoClose() |
boolean |
shouldAutoJoinTransaction()
Indicates whether an active transaction should be automatically joined.
|
void |
update(Object entity)
Update a row.
|
void |
update(String entityName,
Object entity)
Update a row.
|
createQuery, createQuery, createSQLQuery, createSQLQuery, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureCall, errorIfClosed, execute, generateEntityKey, getFactory, getHQLQueryPlan, getJdbcConnectionAccess, getNamedProcedureCall, getNamedQuery, getNamedSQLQuery, getNativeSQLQueryPlan, getSessionIdentifier, getTenantIdentifier, getTransaction, getTransactionCoordinatorBuilder, getWrapperOptions, isClosed, list, scroll, setClosedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateQuery, createSQLQuery, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureCall, getNamedProcedureCall, getNamedQuery, getTenantIdentifier, getTransactionpublic TransactionCoordinator getTransactionCoordinator()
SessionImplementorgetTransactionCoordinator in interface SessionImplementorpublic JdbcCoordinator getJdbcCoordinator()
getJdbcCoordinator in interface SessionImplementorpublic boolean shouldAutoJoinTransaction()
TransactionCoordinatorBuilder.TransactionCoordinatorOptionsshouldAutoJoinTransaction in interface TransactionCoordinatorBuilder.TransactionCoordinatorOptionsshouldAutoJoinTransaction in class AbstractSessionImpltrue indicates the active transaction should be auto joined; false
indicates it should not (until TransactionCoordinator.explicitJoin() is called).public Serializable insert(Object entity)
StatelessSessioninsert in interface StatelessSessionentity - a new transient instancepublic Serializable insert(String entityName, Object entity)
StatelessSessioninsert in interface StatelessSessionentityName - The entityName for the entity to be insertedentity - a new transient instancepublic void delete(Object entity)
StatelessSessiondelete in interface StatelessSessionentity - a detached entity instancepublic void delete(String entityName, Object entity)
StatelessSessiondelete in interface StatelessSessionentityName - The entityName for the entity to be deletedentity - a detached entity instancepublic void update(Object entity)
StatelessSessionupdate in interface StatelessSessionentity - a detached entity instancepublic void update(String entityName, Object entity)
StatelessSessionupdate in interface StatelessSessionentityName - The entityName for the entity to be updatedentity - a detached entity instancepublic Object get(Class entityClass, Serializable id)
StatelessSessionget in interface StatelessSessionentityClass - The class of the entity to retrieveid - The id of the entity to retrievepublic Object get(Class entityClass, Serializable id, LockMode lockMode)
StatelessSessionget in interface StatelessSessionentityClass - The class of the entity to retrieveid - The id of the entity to retrievelockMode - The lock mode to apply to the entitypublic Object get(String entityName, Serializable id)
StatelessSessionget in interface StatelessSessionentityName - The name of the entity to retrieveid - The id of the entity to retrievepublic Object get(String entityName, Serializable id, LockMode lockMode)
StatelessSessionget in interface StatelessSessionentityName - The name of the entity to retrieveid - The id of the entity to retrievelockMode - The lock mode to apply to the entitypublic void refresh(Object entity)
StatelessSessionrefresh in interface StatelessSessionentity - The entity to be refreshed.public void refresh(String entityName, Object entity)
StatelessSessionrefresh in interface StatelessSessionentityName - The entityName for the entity to be refreshed.entity - The entity to be refreshed.public void refresh(Object entity, LockMode lockMode)
StatelessSessionrefresh in interface StatelessSessionentity - The entity to be refreshed.lockMode - The LockMode to be applied.public void refresh(String entityName, Object entity, LockMode lockMode)
StatelessSessionrefresh in interface StatelessSessionentityName - The entityName for the entity to be refreshed.entity - The entity to be refreshed.lockMode - The LockMode to be applied.public Object immediateLoad(String entityName, Serializable id) throws HibernateException
SessionImplementorimmediateLoad in interface SessionImplementorHibernateExceptionpublic void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException
SessionImplementorinitializeCollection in interface SessionImplementorHibernateExceptionpublic Object instantiate(String entityName, Serializable id) throws HibernateException
SessionImplementorinstantiate in interface SessionImplementorHibernateExceptionpublic Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException
SessionImplementorinternalLoad in interface SessionImplementorHibernateExceptionpublic Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException
SessionImplementoriterate in interface SessionImplementorHibernateExceptionpublic Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
SessionImplementoriterateFilter in interface SessionImplementorHibernateExceptionpublic List listFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
SessionImplementorlistFilter in interface SessionImplementorHibernateExceptionpublic boolean isOpen()
isOpen in interface SessionImplementorpublic void close()
StatelessSessionclose in interface Closeableclose in interface AutoCloseableclose in interface StatelessSessionpublic boolean isAutoCloseSessionEnabled()
isAutoCloseSessionEnabled in interface SessionImplementorpublic boolean shouldAutoClose()
shouldAutoClose in interface SessionImplementorpublic SessionEventListenerManager getEventListenerManager()
getEventListenerManager in interface SessionImplementorpublic String bestGuessEntityName(Object object)
SessionImplementorbestGuessEntityName in interface SessionImplementorpublic Connection connection()
StatelessSessionconnection in interface SessionImplementorconnection in interface StatelessSessionpublic int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException
SessionImplementorexecuteUpdate in interface SessionImplementorHibernateExceptionpublic CacheMode getCacheMode()
getCacheMode in interface SessionImplementorpublic int getDontFlushFromFind()
getDontFlushFromFind in interface SessionImplementorpublic Serializable getContextEntityIdentifier(Object object)
SessionImplementorgetContextEntityIdentifier in interface SessionImplementorpublic EntityMode getEntityMode()
public EntityPersister getEntityPersister(String entityName, Object object) throws HibernateException
SessionImplementorgetEntityPersister in interface SessionImplementorentityName - optional entity nameobject - the entity instanceHibernateExceptionpublic Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
SessionImplementorgetEntityUsingInterceptor in interface SessionImplementorHibernateExceptionpublic FlushMode getFlushMode()
getFlushMode in interface SessionImplementorpublic Interceptor getInterceptor()
SessionImplementorgetInterceptor in interface SessionImplementorpublic PersistenceContext getPersistenceContext()
SessionImplementorgetPersistenceContext in interface SessionImplementorpublic long getTimestamp()
SessionImplementorgetTimestamp in interface SessionImplementorpublic String guessEntityName(Object entity) throws HibernateException
SessionImplementorguessEntityName in interface SessionImplementorHibernateExceptionpublic boolean isConnected()
isConnected in interface SessionImplementorpublic boolean isTransactionInProgress()
SessionImplementorisTransactionInProgress in interface SessionImplementorpublic void setAutoClear(boolean enabled)
SessionImplementorsetAutoClear in interface SessionImplementorpublic void disableTransactionAutoJoin()
SessionImplementorSynchronization).
JPA however defines an explicit join transaction operation.
See javax.persistence.EntityManager#joinTransactiondisableTransactionAutoJoin in interface SessionImplementorpublic void setCacheMode(CacheMode cm)
setCacheMode in interface SessionImplementorpublic void setFlushMode(FlushMode fm)
setFlushMode in interface SessionImplementorpublic Transaction beginTransaction() throws HibernateException
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 SharedSessionContractHibernateExceptionSharedSessionContract.getTransaction()public boolean isEventSource()
isEventSource in interface SessionImplementorpublic boolean isDefaultReadOnly()
public void setDefaultReadOnly(boolean readOnly)
throws HibernateException
HibernateExceptionpublic List list(String query, QueryParameters queryParameters) throws HibernateException
SessionImplementorlist in interface SessionImplementorHibernateExceptionpublic void afterOperation(boolean success)
public 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, String alias)
SharedSessionContractCriteria instance for the given entity name, using a specific alias.createCriteria in interface SharedSessionContractentityName - The entity namealias - The alias to usepublic 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(String entityName)
SharedSessionContractCriteria instance for the given entity name.createCriteria in interface SharedSessionContractentityName - The entity namepublic ScrollableResults scroll(Criteria criteria, ScrollMode scrollMode)
SessionImplementorscroll in interface SessionImplementorpublic List list(Criteria criteria) throws HibernateException
SessionImplementorlist in interface SessionImplementorHibernateExceptionpublic List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
SessionImplementorlistCustomQuery in interface SessionImplementorHibernateExceptionpublic ScrollableResults scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
SessionImplementorscrollCustomQuery in interface SessionImplementorHibernateExceptionpublic ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException
SessionImplementorscroll in interface SessionImplementorHibernateExceptionpublic void afterScrollOperation()
afterScrollOperation in interface SessionImplementorpublic void flush()
flush in interface SessionImplementorpublic LoadQueryInfluencers getLoadQueryInfluencers()
SessionImplementorgetLoadQueryInfluencers in interface SessionImplementorpublic int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification, QueryParameters queryParameters) throws HibernateException
SessionImplementorexecuteNativeUpdate in interface SessionImplementorHibernateExceptionpublic JdbcSessionContext getJdbcSessionContext()
getJdbcSessionContext in interface JdbcSessionOwnerpublic 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 JdbcSessionOwnerCopyright © 2017 JBoss by Red Hat. All rights reserved.