|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.internal.AbstractSessionImpl
org.hibernate.internal.StatelessSessionImpl
public class StatelessSessionImpl
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext |
|---|
LobCreationContext.Callback<T> |
| Field Summary |
|---|
| Fields inherited from class org.hibernate.internal.AbstractSessionImpl |
|---|
factory |
| Method Summary | |
|---|---|
void |
afterOperation(boolean success)
|
void |
afterScrollOperation()
|
void |
afterTransactionBegin(TransactionImplementor hibernateTransaction)
|
void |
afterTransactionCompletion(TransactionImplementor hibernateTransaction,
boolean successful)
|
void |
beforeTransactionCompletion(TransactionImplementor hibernateTransaction)
|
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. |
void |
endBatchExecution()
|
void |
endPrepareStatement()
|
void |
endStatementExecution()
|
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()
|
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()
|
ConnectionReleaseMode |
getConnectionReleaseMode()
Get the mode for releasing JDBC connection in effect for ths context. |
Serializable |
getContextEntityIdentifier(Object object)
Return the identifier of the persistent object, or null if not associated with the session |
int |
getDontFlushFromFind()
|
Map |
getEnabledFilters()
Return the currently enabled filters. |
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()
|
String |
getFetchProfile()
Get the internal fetch profile currently associated with this session. |
Type |
getFilterParameterType(String filterParameterName)
Retreive the type for a given filter parrameter. |
Object |
getFilterParameterValue(String filterParameterName)
Retreive the currently set value for a filter parameter. |
FlushMode |
getFlushMode()
|
Interceptor |
getInterceptor()
Retrieves the interceptor currently in use by this event source. |
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 |
Transaction |
getTransaction()
Get the Transaction instance associated with this session. |
TransactionCoordinator |
getTransactionCoordinator()
Retrieve access to the session's transaction coordinator. |
TransactionEnvironment |
getTransactionEnvironment()
Obtain the TransactionEnvironment associated with this context. |
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()
Should session automatically be closed after transaction completion in this context? |
boolean |
isConnected()
|
boolean |
isDefaultReadOnly()
|
boolean |
isEventSource()
|
boolean |
isFlushBeforeCompletionEnabled()
Should before transaction completion processing perform a flush when initiated from JTA synchronization for this context? |
boolean |
isFlushModeNever()
Should flushes only happen manually for this context? |
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 |
managedClose()
Perform a managed close. |
void |
managedFlush()
Perform a managed flush. |
String |
onPrepareStatement(String sql)
|
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 |
setFetchProfile(String name)
Set the current internal fetch profile for this session. |
void |
setFlushMode(FlushMode fm)
|
boolean |
shouldAutoClose()
Should JTA synchronization processing perform a automatic close (call to TransactionContext.managedClose() for this
context? |
boolean |
shouldAutoJoinTransaction()
Should transactions be auto joined? Generally this is only a concern for CMT transactions. |
void |
startBatchExecution()
|
void |
startPrepareStatement()
|
void |
startStatementExecution()
|
void |
update(Object entity)
Update a row. |
void |
update(String entityName,
Object entity)
Update a row. |
| Methods inherited from class org.hibernate.internal.AbstractSessionImpl |
|---|
createQuery, createSQLQuery, errorIfClosed, execute, generateCacheKey, generateEntityKey, getFactory, getHQLQueryPlan, getJdbcConnectionAccess, getNamedQuery, getNamedSQLQuery, getNativeSQLQueryPlan, getSessionIdentifier, getTenantIdentifier, isClosed, list, scroll, setClosed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.hibernate.SharedSessionContract |
|---|
createQuery, createSQLQuery, getNamedQuery, getTenantIdentifier |
| Method Detail |
|---|
public TransactionCoordinator getTransactionCoordinator()
SessionImplementor
getTransactionCoordinator in interface SessionImplementorpublic TransactionEnvironment getTransactionEnvironment()
TransactionContextTransactionEnvironment associated with this context.
getTransactionEnvironment in interface TransactionContextgetTransactionEnvironment in class AbstractSessionImplpublic Serializable insert(Object entity)
StatelessSession
insert in interface StatelessSessionentity - a new transient instance
public Serializable insert(String entityName,
Object entity)
StatelessSession
insert in interface StatelessSessionentityName - The entityName for the entity to be insertedentity - a new transient instance
public void delete(Object entity)
StatelessSession
delete in interface StatelessSessionentity - a detached entity instance
public void delete(String entityName,
Object entity)
StatelessSession
delete in interface StatelessSessionentityName - The entityName for the entity to be deletedentity - a detached entity instancepublic void update(Object entity)
StatelessSession
update in interface StatelessSessionentity - a detached entity instance
public void update(String entityName,
Object entity)
StatelessSession
update in interface StatelessSessionentityName - The entityName for the entity to be updatedentity - a detached entity instance
public Object get(Class entityClass,
Serializable id)
StatelessSession
get in interface StatelessSession
public Object get(Class entityClass,
Serializable id,
LockMode lockMode)
StatelessSession
get in interface StatelessSession
public Object get(String entityName,
Serializable id)
StatelessSession
get in interface StatelessSession
public Object get(String entityName,
Serializable id,
LockMode lockMode)
StatelessSession
get in interface StatelessSessionpublic void refresh(Object entity)
StatelessSession
refresh in interface StatelessSessionentity - The entity to be refreshed.
public void refresh(String entityName,
Object entity)
StatelessSession
refresh in interface StatelessSessionentityName - The entityName for the entity to be refreshed.entity - The entity to be refreshed.
public void refresh(Object entity,
LockMode lockMode)
StatelessSession
refresh in interface StatelessSessionentity - The entity to be refreshed.lockMode - The LockMode to be applied.
public void refresh(String entityName,
Object entity,
LockMode lockMode)
StatelessSession
refresh 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
SessionImplementor
immediateLoad in interface SessionImplementorHibernateException
public void initializeCollection(PersistentCollection collection,
boolean writing)
throws HibernateException
SessionImplementor
initializeCollection in interface SessionImplementorHibernateException
public Object instantiate(String entityName,
Serializable id)
throws HibernateException
SessionImplementor
instantiate in interface SessionImplementorHibernateException
public Object internalLoad(String entityName,
Serializable id,
boolean eager,
boolean nullable)
throws HibernateException
SessionImplementor
internalLoad in interface SessionImplementorHibernateException
public Iterator iterate(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
iterate in interface SessionImplementorHibernateException
public Iterator iterateFilter(Object collection,
String filter,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
iterateFilter in interface SessionImplementorHibernateException
public List listFilter(Object collection,
String filter,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
listFilter in interface SessionImplementorHibernateExceptionpublic boolean isOpen()
isOpen in interface SessionImplementorpublic void close()
StatelessSession
close in interface StatelessSessionpublic ConnectionReleaseMode getConnectionReleaseMode()
TransactionContext
getConnectionReleaseMode in interface TransactionContextpublic boolean shouldAutoJoinTransaction()
TransactionContext
shouldAutoJoinTransaction in interface TransactionContextpublic boolean isAutoCloseSessionEnabled()
TransactionContext
isAutoCloseSessionEnabled in interface TransactionContextpublic boolean isFlushBeforeCompletionEnabled()
TransactionContext
isFlushBeforeCompletionEnabled in interface TransactionContextpublic boolean isFlushModeNever()
TransactionContext
isFlushModeNever in interface TransactionContextpublic void managedClose()
TransactionContext
managedClose in interface TransactionContextpublic void managedFlush()
TransactionContext
managedFlush in interface TransactionContextpublic boolean shouldAutoClose()
TransactionContextTransactionContext.managedClose() for this
context?
shouldAutoClose in interface TransactionContextpublic void afterTransactionBegin(TransactionImplementor hibernateTransaction)
afterTransactionBegin in interface TransactionContextpublic void beforeTransactionCompletion(TransactionImplementor hibernateTransaction)
beforeTransactionCompletion in interface TransactionContext
public void afterTransactionCompletion(TransactionImplementor hibernateTransaction,
boolean successful)
afterTransactionCompletion in interface TransactionContextpublic String onPrepareStatement(String sql)
onPrepareStatement in interface TransactionContextpublic SessionEventListenerManager getEventListenerManager()
getEventListenerManager in interface SessionImplementorpublic void startPrepareStatement()
startPrepareStatement in interface TransactionContextpublic void endPrepareStatement()
endPrepareStatement in interface TransactionContextpublic void startStatementExecution()
startStatementExecution in interface TransactionContextpublic void endStatementExecution()
endStatementExecution in interface TransactionContextpublic void startBatchExecution()
startBatchExecution in interface TransactionContextpublic void endBatchExecution()
endBatchExecution in interface TransactionContextpublic String bestGuessEntityName(Object object)
SessionImplementor
bestGuessEntityName in interface SessionImplementorpublic Connection connection()
StatelessSession
connection in interface SessionImplementorconnection in interface StatelessSession
public int executeUpdate(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
executeUpdate in interface SessionImplementorHibernateExceptionpublic CacheMode getCacheMode()
getCacheMode in interface SessionImplementorpublic int getDontFlushFromFind()
getDontFlushFromFind in interface SessionImplementorpublic Map getEnabledFilters()
SessionImplementorFilterImpl
instance.
getEnabledFilters in interface SessionImplementorpublic Serializable getContextEntityIdentifier(Object object)
SessionImplementor
getContextEntityIdentifier in interface SessionImplementorpublic EntityMode getEntityMode()
public EntityPersister getEntityPersister(String entityName,
Object object)
throws HibernateException
SessionImplementor
getEntityPersister in interface SessionImplementorentityName - optional entity nameobject - the entity instance
HibernateException
public Object getEntityUsingInterceptor(EntityKey key)
throws HibernateException
SessionImplementor
getEntityUsingInterceptor in interface SessionImplementorHibernateExceptionpublic Type getFilterParameterType(String filterParameterName)
SessionImplementor
getFilterParameterType in interface SessionImplementorfilterParameterName - The filter parameter name in the format
{FILTER_NAME.PARAMETER_NAME}.
public Object getFilterParameterValue(String filterParameterName)
SessionImplementor
getFilterParameterValue in interface SessionImplementorfilterParameterName - The filter parameter name in the format
{FILTER_NAME.PARAMETER_NAME}.
public FlushMode getFlushMode()
getFlushMode in interface SessionImplementorpublic Interceptor getInterceptor()
SessionImplementor
getInterceptor in interface SessionImplementorpublic PersistenceContext getPersistenceContext()
SessionImplementor
getPersistenceContext in interface SessionImplementorpublic long getTimestamp()
SessionImplementor
getTimestamp in interface SessionImplementor
public String guessEntityName(Object entity)
throws HibernateException
SessionImplementor
guessEntityName in interface SessionImplementorHibernateExceptionpublic boolean isConnected()
isConnected in interface SessionImplementorpublic boolean isTransactionInProgress()
SessionImplementor
isTransactionInProgress in interface SessionImplementorpublic void setAutoClear(boolean enabled)
SessionImplementor
setAutoClear in interface SessionImplementorpublic void disableTransactionAutoJoin()
SessionImplementorSynchronization).
JPA however defines an explicit join transaction operation.
See javax.persistence.EntityManager#joinTransaction
disableTransactionAutoJoin in interface SessionImplementorpublic void setCacheMode(CacheMode cm)
setCacheMode in interface SessionImplementorpublic void setFlushMode(FlushMode fm)
setFlushMode in interface SessionImplementor
public Transaction getTransaction()
throws HibernateException
SharedSessionContractTransaction instance associated with this session. The concrete type of the returned
Transaction object is determined by the hibernate.transaction_factory property.
getTransaction in interface SharedSessionContractHibernateException
public 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
HibernateException
public List list(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
list 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 use
public 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 use
public 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/implementors
public Criteria createCriteria(String entityName)
SharedSessionContractCriteria instance for the given entity name.
createCriteria in interface SharedSessionContractentityName - The entity name
public ScrollableResults scroll(Criteria criteria,
ScrollMode scrollMode)
SessionImplementor
scroll in interface SessionImplementor
public List list(Criteria criteria)
throws HibernateException
SessionImplementor
list in interface SessionImplementorHibernateException
public List listCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
listCustomQuery in interface SessionImplementorHibernateException
public ScrollableResults scrollCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
scrollCustomQuery in interface SessionImplementorHibernateException
public ScrollableResults scroll(String query,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
scroll in interface SessionImplementorHibernateExceptionpublic void afterScrollOperation()
afterScrollOperation in interface SessionImplementorpublic void flush()
flush in interface SessionImplementorpublic String getFetchProfile()
SessionImplementor
getFetchProfile in interface SessionImplementorpublic LoadQueryInfluencers getLoadQueryInfluencers()
SessionImplementor
getLoadQueryInfluencers in interface SessionImplementorpublic void setFetchProfile(String name)
SessionImplementor
setFetchProfile in interface SessionImplementorname - The internal fetch profile name to use
public int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
executeNativeUpdate in interface SessionImplementorHibernateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||