|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.internal.AbstractSessionImpl
public abstract class AbstractSessionImpl
Functionality common to stateless and stateful sessions
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext |
|---|
LobCreationContext.Callback<T> |
| Field Summary | |
|---|---|
protected SessionFactoryImpl |
factory
|
| Constructor Summary | |
|---|---|
protected |
AbstractSessionImpl(SessionFactoryImpl factory,
String tenantIdentifier)
|
| Method Summary | ||
|---|---|---|
Query |
createQuery(String queryString)
Create a Query instance for the given HQL query string. |
|
SQLQuery |
createSQLQuery(String sql)
Create a SQLQuery instance for the given SQL query string. |
|
protected void |
errorIfClosed()
|
|
|
execute(LobCreationContext.Callback<T> callback)
Execute the given callback, making sure it has access to a viable JDBC Connection. |
|
CacheKey |
generateCacheKey(Serializable id,
Type type,
String entityOrRoleName)
Hide the changing requirements of cache key creation. |
|
EntityKey |
generateEntityKey(Serializable id,
EntityPersister persister)
Hide the changing requirements of entity key creation |
|
SessionFactoryImplementor |
getFactory()
Get the creating SessionFactoryImplementor |
|
protected HQLQueryPlan |
getHQLQueryPlan(String query,
boolean shallow)
|
|
JdbcConnectionAccess |
getJdbcConnectionAccess()
Provides access to JDBC connections |
|
Query |
getNamedQuery(String queryName)
Create a Query instance for the named query string defined in the metadata. |
|
Query |
getNamedSQLQuery(String queryName)
Get a Query instance for a named native SQL query |
|
protected NativeSQLQueryPlan |
getNativeSQLQueryPlan(NativeSQLQuerySpecification spec)
|
|
UUID |
getSessionIdentifier()
|
|
String |
getTenantIdentifier()
Obtain the tenant identifier associated with this session. |
|
TransactionEnvironment |
getTransactionEnvironment()
Obtain the TransactionEnvironment associated with this context. |
|
boolean |
isClosed()
Determine whether the session is closed. |
|
List |
list(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
Execute a native SQL query, and return the results as a fully built list. |
|
ScrollableResults |
scroll(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
Execute a native SQL query, and return the results as a scrollable result. |
|
protected void |
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 |
|---|
beginTransaction, createCriteria, createCriteria, createCriteria, createCriteria, getTransaction |
| Methods inherited from interface org.hibernate.engine.transaction.spi.TransactionContext |
|---|
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, endBatchExecution, endPrepareStatement, endStatementExecution, getConnectionReleaseMode, isAutoCloseSessionEnabled, isFlushBeforeCompletionEnabled, isFlushModeNever, managedClose, managedFlush, onPrepareStatement, shouldAutoClose, shouldAutoJoinTransaction, startBatchExecution, startPrepareStatement, startStatementExecution |
| Field Detail |
|---|
protected transient SessionFactoryImpl factory
| Constructor Detail |
|---|
protected AbstractSessionImpl(SessionFactoryImpl factory,
String tenantIdentifier)
| Method Detail |
|---|
public SessionFactoryImplementor getFactory()
SessionImplementor
getFactory in interface SessionImplementorpublic TransactionEnvironment getTransactionEnvironment()
TransactionContextTransactionEnvironment associated with this context.
getTransactionEnvironment in interface TransactionContextpublic <T> T execute(LobCreationContext.Callback<T> callback)
LobCreationContextConnection.
execute in interface LobCreationContextcallback - The callback to execute .
public boolean isClosed()
SessionImplementorSessionImplementor.isOpen() as this method does not attempt any JTA synchronization
registration, where as SessionImplementor.isOpen() does; which makes this one
nicer to use for most internal purposes.
isClosed in interface SessionImplementorisClosed in interface TransactionContextprotected void setClosed()
protected void errorIfClosed()
public Query getNamedQuery(String queryName)
throws MappingException
SharedSessionContractQuery instance for the named query string defined in the metadata.
getNamedQuery in interface SessionImplementorgetNamedQuery in interface SharedSessionContractqueryName - the name of a query defined externally
MappingException
public Query getNamedSQLQuery(String queryName)
throws MappingException
SessionImplementor
getNamedSQLQuery in interface SessionImplementorMappingExceptionpublic Query createQuery(String queryString)
SharedSessionContractQuery instance for the given HQL query string.
createQuery in interface SharedSessionContractqueryString - The HQL query
public SQLQuery createSQLQuery(String sql)
SharedSessionContractSQLQuery instance for the given SQL query string.
createSQLQuery in interface SharedSessionContractsql - The SQL query
protected HQLQueryPlan getHQLQueryPlan(String query,
boolean shallow)
throws HibernateException
HibernateException
protected NativeSQLQueryPlan getNativeSQLQueryPlan(NativeSQLQuerySpecification spec)
throws HibernateException
HibernateException
public List list(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
list in interface SessionImplementorspec - The specification of the native SQL query to execute.queryParameters - The parameters by which to perform the execution.
HibernateException
public ScrollableResults scroll(NativeSQLQuerySpecification spec,
QueryParameters queryParameters)
throws HibernateException
SessionImplementor
scroll in interface SessionImplementorspec - The specification of the native SQL query to execute.queryParameters - The parameters by which to perform the execution.
HibernateExceptionpublic String getTenantIdentifier()
SharedSessionContract
getTenantIdentifier in interface SessionImplementorgetTenantIdentifier in interface SharedSessionContractnull
public EntityKey generateEntityKey(Serializable id,
EntityPersister persister)
SessionImplementor
generateEntityKey in interface SessionImplementorid - The entity idpersister - The entity persister
public CacheKey generateCacheKey(Serializable id,
Type type,
String entityOrRoleName)
SessionImplementor
generateCacheKey in interface SessionImplementorid - The entity identifier or collection key.type - The typeentityOrRoleName - The entity name or collection role.
public JdbcConnectionAccess getJdbcConnectionAccess()
SessionImplementor
getJdbcConnectionAccess in interface SessionImplementorgetJdbcConnectionAccess in interface TransactionContextpublic UUID getSessionIdentifier()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||