public abstract class

AbstractSessionImpl

extends Object
implements SessionImplementor
java.lang.Object
   ↳ org.hibernate.impl.AbstractSessionImpl
Known Direct Subclasses

Class Overview

Functionality common to stateless and stateful sessions

Summary

Fields
protected SessionFactoryImpl factory
Protected Constructors
AbstractSessionImpl(SessionFactoryImpl factory)
Public Methods
Query createQuery(String queryString)
SQLQuery createSQLQuery(String sql)
SessionFactoryImplementor getFactory()
Get the creating SessionFactoryImplementor
Query getNamedQuery(String queryName)
Get a Query instance for a named query or named native SQL query
Query getNamedSQLQuery(String queryName)
Get a Query instance for a named native SQL query
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 Methods
void errorIfClosed()
HQLQueryPlan getHQLQueryPlan(String query, boolean shallow)
NativeSQLQueryPlan getNativeSQLQueryPlan(NativeSQLQuerySpecification spec)
void setClosed()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.engine.SessionImplementor

Fields

protected SessionFactoryImpl factory

Protected Constructors

protected AbstractSessionImpl (SessionFactoryImpl factory)

Public Methods

public Query createQuery (String queryString)

public SQLQuery createSQLQuery (String sql)

public SessionFactoryImplementor getFactory ()

Get the creating SessionFactoryImplementor

public Query getNamedQuery (String queryName)

Get a Query instance for a named query or named native SQL query

public Query getNamedSQLQuery (String queryName)

Get a Query instance for a named native SQL query

public boolean isClosed ()

Determine whether the session is closed. Provided seperately from isOpen() as this method does not attempt any JTA synch registration, where as isOpen() does; which makes this one nicer to use for most internal purposes.

Returns
  • True if the session is closed; false otherwise.

public List list (NativeSQLQuerySpecification spec, QueryParameters queryParameters)

Execute a native SQL query, and return the results as a fully built list.

Parameters
spec The specification of the native SQL query to execute.
queryParameters The parameters by which to perform the execution.
Returns
  • The result list.

public ScrollableResults scroll (NativeSQLQuerySpecification spec, QueryParameters queryParameters)

Execute a native SQL query, and return the results as a scrollable result.

Parameters
spec The specification of the native SQL query to execute.
queryParameters The parameters by which to perform the execution.
Returns
  • The resulting scrollable result.

Protected Methods

protected void errorIfClosed ()

protected HQLQueryPlan getHQLQueryPlan (String query, boolean shallow)

protected NativeSQLQueryPlan getNativeSQLQueryPlan (NativeSQLQuerySpecification spec)

protected void setClosed ()