Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hibernate.impl
Class SessionImpl  view SessionImpl download SessionImpl.java

java.lang.Object
  extended byorg.hibernate.impl.AbstractSessionImpl
      extended byorg.hibernate.impl.SessionImpl
All Implemented Interfaces:
org.hibernate.event.EventSource, org.hibernate.jdbc.JDBCContext.Context, java.io.Serializable, org.hibernate.classic.Session, org.hibernate.Session, org.hibernate.engine.SessionImplementor, org.hibernate.transaction.TransactionFactory.Context

public final class SessionImpl
extends AbstractSessionImpl
implements org.hibernate.event.EventSource, org.hibernate.classic.Session, org.hibernate.jdbc.JDBCContext.Context

Concrete implementation of a Session, and also the central, organizing component of Hibernate's internal implementation. As such, this class exposes two interfaces; Session itself, to the application, and SessionImplementor, to other components of Hibernate. This class is not threadsafe.


Field Summary
private  org.hibernate.engine.ActionQueue actionQueue
           
private  boolean autoClear
           
private  boolean autoCloseSessionEnabled
           
private  org.hibernate.CacheMode cacheMode
           
private  java.util.Map childSessionsByEntityMode
           
private  org.hibernate.ConnectionReleaseMode connectionReleaseMode
           
private  int dontFlushFromFind
           
private  java.util.Map enabledFilters
           
private  org.hibernate.EntityMode entityMode
           
private  java.lang.String fetchProfile
           
private  boolean flushBeforeCompletionEnabled
           
private  org.hibernate.FlushMode flushMode
           
private  org.hibernate.Interceptor interceptor
           
private  org.hibernate.jdbc.JDBCContext jdbcContext
           
private  org.hibernate.event.EventListeners listeners
           
private static org.apache.commons.logging.Log log
           
private  org.hibernate.engine.StatefulPersistenceContext persistenceContext
           
private  org.hibernate.Session rootSession
           
private  long timestamp
           
 
Fields inherited from class org.hibernate.impl.AbstractSessionImpl
factory
 
Constructor Summary
(package private) SessionImpl(java.sql.Connection connection, SessionFactoryImpl factory, boolean autoclose, long timestamp, org.hibernate.Interceptor interceptor, org.hibernate.EntityMode entityMode, boolean flushBeforeCompletionEnabled, boolean autoCloseSessionEnabled, org.hibernate.ConnectionReleaseMode connectionReleaseMode)
          Constructor used for openSession(...) processing, as well as construction of sessions for getCurrentSession().
private SessionImpl(SessionImpl parent, org.hibernate.EntityMode entityMode)
          Constructor used in building "child sessions".
 
Method Summary
 void afterOperation(boolean success)
          Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, make sure the connection has been committed (if it is not in autocommit mode) and run the after completion processing
 void afterScrollOperation()
           
 void afterTransactionBegin(org.hibernate.Transaction tx)
          We cannot rely upon this method being called! It is only called if we are using Hibernate Transaction API.
 void afterTransactionCompletion(boolean success, org.hibernate.Transaction tx)
          Notify the session that the transaction completed, so we no longer own the old locks.
protected  boolean autoFlushIfRequired(java.util.Set querySpaces)
          detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flush
 void beforeTransactionCompletion(org.hibernate.Transaction tx)
          Notify the session that the transaction is about to complete
 org.hibernate.Transaction beginTransaction()
          Begin a unit of work and return the associated Transaction object.
 java.lang.String bestGuessEntityName(java.lang.Object object)
          The best guess entity name for an entity not in an association
 void cancelQuery()
          Cancel execution of the current query.
private  void checkTransactionSynchStatus()
           
private  void cleanup()
          clear all the internal collections, just to help the garbage collector, does not clear anything that is needed during the afterTransactionCompletion() phase
 void clear()
          Completely clear the session.
 java.sql.Connection close()
          End the Session by disconnecting from the JDBC connection and cleaning up.
 java.sql.Connection connection()
          Get the JDBC connection of this Session.

If the session is using aggressive collection release (as in a CMT environment), it is the application's responsibility to close the connection returned by this call.
 boolean contains(java.lang.Object object)
          Check if this instance is associated with this Session.
 org.hibernate.Criteria createCriteria(java.lang.Class persistentClass)
          Create a new Criteria instance, for the given entity class, or a superclass of an entity class.
 org.hibernate.Criteria createCriteria(java.lang.Class persistentClass, java.lang.String alias)
          Create a new Criteria instance, for the given entity class, or a superclass of an entity class, with the given alias.
 org.hibernate.Criteria createCriteria(java.lang.String entityName)
          Create a new Criteria instance, for the given entity name.
 org.hibernate.Criteria createCriteria(java.lang.String entityName, java.lang.String alias)
          Create a new Criteria instance, for the given entity name, with the given alias.
 org.hibernate.Query createFilter(java.lang.Object collection, java.lang.String queryString)
          Create a new instance of Query for the given collection and filter string.
 org.hibernate.Query createQuery(java.lang.String queryString)
          Create a new instance of Query for the given HQL query string.
 org.hibernate.SQLQuery createSQLQuery(java.lang.String sql)
          Create a new instance of SQLQuery for the given SQL query string.
 org.hibernate.Query createSQLQuery(java.lang.String sql, java.lang.String[] returnAliases, java.lang.Class[] returnClasses)
          Create a new instance of Query for the given SQL string.
 org.hibernate.Query createSQLQuery(java.lang.String sql, java.lang.String returnAlias, java.lang.Class returnClass)
          Create a new instance of Query for the given SQL string.
 void delete(java.lang.Object object)
          Delete a persistent object
 int delete(java.lang.String query)
          Delete all objects returned by the query.
 void delete(java.lang.String entityName, java.lang.Object object)
          Delete a persistent object (by explicit entity name)
 int delete(java.lang.String query, java.lang.Object[] values, org.hibernate.type.Type[] types)
          Delete all objects returned by the query.
 void delete(java.lang.String entityName, java.lang.Object object, boolean isCascadeDeleteEnabled)
          Delete a persistent object
 int delete(java.lang.String query, java.lang.Object value, org.hibernate.type.Type type)
          Delete all objects returned by the query.
 void disableFilter(java.lang.String filterName)
          Disable the named filter for the current session.
 java.sql.Connection disconnect()
          Disconnect the Session from the current JDBC connection.
 org.hibernate.Filter enableFilter(java.lang.String filterName)
          Enable the named filter for this current session.
 void evict(java.lang.Object object)
          remove any hard references to the entity that are held by the infrastructure (references held by application or other persistant instances are okay)
 int executeNativeUpdate(org.hibernate.engine.query.NativeSQLQuerySpecification nativeQuerySpecification, org.hibernate.engine.QueryParameters queryParameters)
          Execute a native SQL update or delete query
 int executeUpdate(java.lang.String query, org.hibernate.engine.QueryParameters queryParameters)
          Execute a HQL update or delete query
 java.util.Collection filter(java.lang.Object collection, java.lang.String filter)
          Apply a filter to a persistent collection.
 java.util.Collection filter(java.lang.Object collection, java.lang.String filter, java.lang.Object[] values, org.hibernate.type.Type[] types)
          Apply a filter to a persistent collection.
 java.util.Collection filter(java.lang.Object collection, java.lang.String filter, java.lang.Object value, org.hibernate.type.Type type)
          Apply a filter to a persistent collection.
 java.util.List find(java.lang.String query)
          Retrieve a list of persistent objects using a hibernate query
 java.util.List find(java.lang.String query, java.lang.Object[] values, org.hibernate.type.Type[] types)
          Execute a query with bind parameters, binding an array of values to "?" parameters in the query string.
 java.util.List find(java.lang.String query, java.lang.Object value, org.hibernate.type.Type type)
          Execute a query with bind parameters, binding a value to a "?" parameter in the query string.
private  void fireDelete(org.hibernate.event.DeleteEvent event)
           
private  void fireEvict(org.hibernate.event.EvictEvent evictEvent)
           
private  void fireLoad(org.hibernate.event.LoadEvent event, org.hibernate.event.LoadEventListener.LoadType loadType)
           
private  void fireLock(org.hibernate.event.LockEvent lockEvent)
           
private  void fireMerge(java.util.Map copiedAlready, org.hibernate.event.MergeEvent event)
           
private  java.lang.Object fireMerge(org.hibernate.event.MergeEvent event)
           
private  void firePersist(java.util.Map copiedAlready, org.hibernate.event.PersistEvent event)
           
private  void firePersist(org.hibernate.event.PersistEvent event)
           
private  void firePersistOnFlush(java.util.Map copiedAlready, org.hibernate.event.PersistEvent event)
           
private  void firePersistOnFlush(org.hibernate.event.PersistEvent event)
           
private  void fireRefresh(java.util.Map refreshedAlready, org.hibernate.event.RefreshEvent refreshEvent)
           
private  void fireRefresh(org.hibernate.event.RefreshEvent refreshEvent)
           
private  void fireReplicate(org.hibernate.event.ReplicateEvent event)
           
private  java.io.Serializable fireSave(org.hibernate.event.SaveOrUpdateEvent event)
           
private  void fireSaveOrUpdate(org.hibernate.event.SaveOrUpdateEvent event)
           
private  void fireSaveOrUpdateCopy(java.util.Map copiedAlready, org.hibernate.event.MergeEvent event)
           
private  java.lang.Object fireSaveOrUpdateCopy(org.hibernate.event.MergeEvent event)
           
private  void fireUpdate(org.hibernate.event.SaveOrUpdateEvent event)
           
 void flush()
          Force the Session to flush.
 void forceFlush(org.hibernate.engine.EntityEntry entityEntry)
          Force an immediate flush
 java.lang.Object get(java.lang.Class entityClass, java.io.Serializable id)
          Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
 java.lang.Object get(java.lang.Class entityClass, java.io.Serializable id, org.hibernate.LockMode lockMode)
          Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
 java.lang.Object get(java.lang.String entityName, java.io.Serializable id)
          Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance.
 java.lang.Object get(java.lang.String entityName, java.io.Serializable id, org.hibernate.LockMode lockMode)
          Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
 org.hibernate.engine.ActionQueue getActionQueue()
          Get the ActionQueue for this session
 org.hibernate.jdbc.Batcher getBatcher()
          Get the prepared statement Batcher for this session
 org.hibernate.CacheMode getCacheMode()
          Get the current cache mode.
 org.hibernate.ConnectionReleaseMode getConnectionReleaseMode()
           
 java.io.Serializable getContextEntityIdentifier(java.lang.Object object)
          Get the id value for an object that is actually associated with the session.
 org.hibernate.LockMode getCurrentLockMode(java.lang.Object object)
          Determine the current lock mode of the given object.
 int getDontFlushFromFind()
           
 org.hibernate.Filter getEnabledFilter(java.lang.String filterName)
          Retrieve a currently enabled filter by name.
 java.util.Map getEnabledFilters()
          Return the currently enabled filters.
 org.hibernate.EntityMode getEntityMode()
          Retrieve the entity mode in effect for this session.
 java.lang.String getEntityName(java.lang.Object object)
          Return the entity name for a persistent entity
 org.hibernate.persister.entity.EntityPersister getEntityPersister(java.lang.String entityName, java.lang.Object object)
          Get the EntityPersister for any instance
 java.lang.Object getEntityUsingInterceptor(org.hibernate.engine.EntityKey key)
          Get the entity instance associated with the given Key, calling the Interceptor if necessary
 java.lang.String getFetchProfile()
           
 org.hibernate.type.Type getFilterParameterType(java.lang.String filterParameterName)
          Retreive the type for a given filter parrameter.
 java.lang.Object getFilterParameterValue(java.lang.String filterParameterName)
          Retreive the currently set value for a filter parameter.
private  org.hibernate.engine.query.FilterQueryPlan getFilterQueryPlan(java.lang.Object collection, java.lang.String filter, org.hibernate.engine.QueryParameters parameters, boolean shallow)
           
 org.hibernate.FlushMode getFlushMode()
          Get the current flush mode.
 java.io.Serializable getIdentifier(java.lang.Object object)
          Return the identifier of an entity instance cached by the Session, or throw an exception if the instance is transient or associated with a different Session.
 org.hibernate.Interceptor getInterceptor()
          Retrieves the interceptor currently in use by this event source.
 org.hibernate.jdbc.JDBCContext getJDBCContext()
           
 org.hibernate.event.EventListeners getListeners()
          Retrieves the configured event listeners from this event source.
 org.hibernate.Query getNamedQuery(java.lang.String queryName)
          Get a Query instance for a named query or named native SQL query
private  org.hibernate.persister.entity.OuterJoinLoadable getOuterJoinLoadable(java.lang.String entityName)
           
 org.hibernate.engine.PersistenceContext getPersistenceContext()
          Get the persistence context for this session
private  java.io.Serializable getProxyIdentifier(java.lang.Object proxy)
           
 org.hibernate.Session getSession(org.hibernate.EntityMode entityMode)
          Starts a new Session with the given entity mode in effect.
 org.hibernate.SessionFactory getSessionFactory()
          Get the SessionFactory that created this instance.
 org.hibernate.stat.SessionStatistics getStatistics()
          Get the statistics for this session.
 long getTimestamp()
          System time before the start of the transaction
 org.hibernate.Transaction getTransaction()
          Get the Transaction instance associated with this session.
 java.lang.String guessEntityName(java.lang.Object object)
          The guessed entity name for an entity not in an association
 java.lang.Object immediateLoad(java.lang.String entityName, java.io.Serializable id)
          Load the data for the object with the specified id into a newly created object.
 void initializeCollection(org.hibernate.collection.PersistentCollection collection, boolean writing)
          Initialize the collection (if not already initialized)
 java.lang.Object instantiate(org.hibernate.persister.entity.EntityPersister persister, java.io.Serializable id)
          give the interceptor an opportunity to override the default instantiation
 java.lang.Object instantiate(java.lang.String entityName, java.io.Serializable id)
          Instantiate the entity class, initializing with the given identifier
 java.lang.Object internalLoad(java.lang.String entityName, java.io.Serializable id, boolean eager, boolean nullable)
          Load an instance without checking if it was deleted.
 boolean isAutoCloseSessionEnabled()
           
 boolean isConnected()
          Check if the Session is currently connected.
 boolean isDirty()
          Does this Session contain any changes which must be synchronized with the database? Would any SQL be executed if we flushed this session?
 boolean isEventSource()
           
 boolean isFlushBeforeCompletionEnabled()
           
 boolean isFlushModeNever()
           
 boolean isOpen()
          Check if the Session is still open.
 boolean isTransactionInProgress()
          Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?
 java.util.Iterator iterate(java.lang.String query)
          Execute a query and return the results in an iterator.
 java.util.Iterator iterate(java.lang.String query, java.lang.Object[] values, org.hibernate.type.Type[] types)
          Execute a query and return the results in an iterator.
 java.util.Iterator iterate(java.lang.String query, java.lang.Object value, org.hibernate.type.Type type)
          Execute a query and return the results in an iterator.
 java.util.Iterator iterate(java.lang.String query, org.hibernate.engine.QueryParameters queryParameters)
          Execute an iterate() query
 java.util.Iterator iterateFilter(java.lang.Object collection, java.lang.String filter, org.hibernate.engine.QueryParameters queryParameters)
          Iterate a filter
 java.util.List list(CriteriaImpl criteria)
          Execute a criteria query
 java.util.List list(java.lang.String query, org.hibernate.engine.QueryParameters queryParameters)
          Execute a find() query
 java.util.List listCustomQuery(org.hibernate.loader.custom.CustomQuery customQuery, org.hibernate.engine.QueryParameters queryParameters)
          Execute an SQL Query
 java.util.List listFilter(java.lang.Object collection, java.lang.String filter, org.hibernate.engine.QueryParameters queryParameters)
          Execute a filter
 java.lang.Object load(java.lang.Class entityClass, java.io.Serializable id)
          Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.
 java.lang.Object load(java.lang.Class entityClass, java.io.Serializable id, org.hibernate.LockMode lockMode)
          Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
 void load(java.lang.Object object, java.io.Serializable id)
          Read the persistent state associated with the given identifier into the given transient instance.
 java.lang.Object load(java.lang.String entityName, java.io.Serializable id)
          Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.
 java.lang.Object load(java.lang.String entityName, java.io.Serializable id, org.hibernate.LockMode lockMode)
          Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
 void lock(java.lang.Object object, org.hibernate.LockMode lockMode)
          Obtain the specified lock level upon the given object.
 void lock(java.lang.String entityName, java.lang.Object object, org.hibernate.LockMode lockMode)
          Obtain the specified lock level upon the given object.
 void managedClose()
           
 void managedFlush()
           
 java.lang.Object merge(java.lang.Object object)
          Copy the state of the given object onto the persistent object with the same identifier.
 java.lang.Object merge(java.lang.String entityName, java.lang.Object object)
          Copy the state of the given object onto the persistent object with the same identifier.
 void merge(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)
          Cascade merge an entity instance
private  java.lang.String[] parseFilterParameterName(java.lang.String filterParameterName)
           
 void persist(java.lang.Object object)
          Make a transient instance persistent.
 void persist(java.lang.String entityName, java.lang.Object object)
          Make a transient instance persistent.
 void persist(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)
          Cascade persist an entity instance
 void persistOnFlush(java.lang.Object object)
           
 void persistOnFlush(java.lang.String entityName, java.lang.Object object)
           
 void persistOnFlush(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)
          Cascade persist an entity instance during the flush process
private  void readObject(java.io.ObjectInputStream ois)
          Used by JDK serialization...
 void reconnect()
          Obtain a new JDBC connection.
 void reconnect(java.sql.Connection conn)
          Reconnect to the given JDBC connection.
 void refresh(java.lang.Object object)
          Re-read the state of the given instance from the underlying database.
 void refresh(java.lang.Object object, org.hibernate.LockMode lockMode)
          Re-read the state of the given instance from the underlying database, with the given LockMode.
 void refresh(java.lang.Object object, java.util.Map refreshedAlready)
          Cascade refesh an entity instance
 void replicate(java.lang.Object obj, org.hibernate.ReplicationMode replicationMode)
          Persist the state of the given detached instance, reusing the current identifier value.
 void replicate(java.lang.String entityName, java.lang.Object obj, org.hibernate.ReplicationMode replicationMode)
          Persist the state of the given detached instance, reusing the current identifier value.
 java.io.Serializable save(java.lang.Object obj)
          Persist the given transient instance, first assigning a generated identifier.
 void save(java.lang.Object obj, java.io.Serializable id)
          Persist the given transient instance, using the given identifier.
 java.io.Serializable save(java.lang.String entityName, java.lang.Object object)
          Persist the given transient instance, first assigning a generated identifier.
 void save(java.lang.String entityName, java.lang.Object object, java.io.Serializable id)
          Persist the given transient instance, using the given identifier.
 void saveOrUpdate(java.lang.Object object)
          Either save() or update() the given instance, depending upon the value of its identifier property.
 void saveOrUpdate(java.lang.String entityName, java.lang.Object obj)
          Either save() or update() the given instance, depending upon the value of its identifier property.
 java.lang.Object saveOrUpdateCopy(java.lang.Object object)
          Copy the state of the given object onto the persistent object with the same identifier.
 java.lang.Object saveOrUpdateCopy(java.lang.Object object, java.io.Serializable id)
          Copy the state of the given object onto the persistent object with the given identifier.
 java.lang.Object saveOrUpdateCopy(java.lang.String entityName, java.lang.Object object)
          Copy the state of the given object onto the persistent object with the same identifier.
 void saveOrUpdateCopy(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)
          Cascade copy an entity instance
 java.lang.Object saveOrUpdateCopy(java.lang.String entityName, java.lang.Object object, java.io.Serializable id)
          Copy the state of the given object onto the persistent object with the given identifier.
 org.hibernate.ScrollableResults scroll(CriteriaImpl criteria, org.hibernate.ScrollMode scrollMode)
          Execute a criteria query
 org.hibernate.ScrollableResults scroll(java.lang.String query, org.hibernate.engine.QueryParameters queryParameters)
          Execute a scroll() query
 org.hibernate.ScrollableResults scrollCustomQuery(org.hibernate.loader.custom.CustomQuery customQuery, org.hibernate.engine.QueryParameters queryParameters)
          Execute an SQL Query
 void setAutoClear(boolean enabled)
          Enable/disable automatic cache clearing from after transaction completion (for EJB3)
 void setCacheMode(org.hibernate.CacheMode cacheMode)
          Set the cache mode.
 void setFetchProfile(java.lang.String fetchProfile)
           
 void setFlushMode(org.hibernate.FlushMode flushMode)
          Set the flush mode.
 void setReadOnly(java.lang.Object entity, boolean readOnly)
          Set an unmodified persistent object to read only mode, or a read only object to modifiable mode.
 boolean shouldAutoClose()
           
private  void throwTransientObjectException(java.lang.Object object)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 void update(java.lang.Object obj)
          Update the persistent instance with the identifier of the given detached instance.
 void update(java.lang.Object obj, java.io.Serializable id)
          Update the persistent state associated with the given identifier.
 void update(java.lang.String entityName, java.lang.Object object)
          Update the persistent instance with the identifier of the given detached instance.
 void update(java.lang.String entityName, java.lang.Object object, java.io.Serializable id)
          Update the persistent state associated with the given identifier.
private  void writeObject(java.io.ObjectOutputStream oos)
          Used by JDK serialization...
 
Methods inherited from class org.hibernate.impl.AbstractSessionImpl
errorIfClosed, getFactory, getHQLQueryPlan, getNamedSQLQuery, getNativeSQLQueryPlan, isClosed, list, scroll, setClosed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hibernate.engine.SessionImplementor
getFactory, getNamedSQLQuery, isClosed, list, scroll
 
Methods inherited from interface org.hibernate.transaction.TransactionFactory.Context
getFactory, isClosed
 

Field Detail

log

private static final org.apache.commons.logging.Log log

entityMode

private transient org.hibernate.EntityMode entityMode

autoClear

private transient boolean autoClear

timestamp

private transient long timestamp

flushMode

private transient org.hibernate.FlushMode flushMode

cacheMode

private transient org.hibernate.CacheMode cacheMode

interceptor

private transient org.hibernate.Interceptor interceptor

dontFlushFromFind

private transient int dontFlushFromFind

actionQueue

private transient org.hibernate.engine.ActionQueue actionQueue

persistenceContext

private transient org.hibernate.engine.StatefulPersistenceContext persistenceContext

jdbcContext

private transient org.hibernate.jdbc.JDBCContext jdbcContext

listeners

private transient org.hibernate.event.EventListeners listeners

flushBeforeCompletionEnabled

private transient boolean flushBeforeCompletionEnabled

autoCloseSessionEnabled

private transient boolean autoCloseSessionEnabled

connectionReleaseMode

private transient org.hibernate.ConnectionReleaseMode connectionReleaseMode

fetchProfile

private transient java.lang.String fetchProfile

enabledFilters

private transient java.util.Map enabledFilters

rootSession

private transient org.hibernate.Session rootSession

childSessionsByEntityMode

private transient java.util.Map childSessionsByEntityMode
Constructor Detail

SessionImpl

private SessionImpl(SessionImpl parent,
                    org.hibernate.EntityMode entityMode)
Constructor used in building "child sessions".


SessionImpl

SessionImpl(java.sql.Connection connection,
            SessionFactoryImpl factory,
            boolean autoclose,
            long timestamp,
            org.hibernate.Interceptor interceptor,
            org.hibernate.EntityMode entityMode,
            boolean flushBeforeCompletionEnabled,
            boolean autoCloseSessionEnabled,
            org.hibernate.ConnectionReleaseMode connectionReleaseMode)
Constructor used for openSession(...) processing, as well as construction of sessions for getCurrentSession().

Method Detail

getSession

public org.hibernate.Session getSession(org.hibernate.EntityMode entityMode)
Description copied from interface: org.hibernate.Session
Starts a new Session with the given entity mode in effect. This secondary Session inherits the connection, transaction, and other context information from the primary Session. It doesn't need to be flushed or closed by the developer.

Specified by:
getSession in interface org.hibernate.Session

clear

public void clear()
Description copied from interface: org.hibernate.Session
Completely clear the session. Evict all loaded instances and cancel all pending saves, updates and deletions. Do not close open iterators or instances of ScrollableResults.

Specified by:
clear in interface org.hibernate.Session

getBatcher

public org.hibernate.jdbc.Batcher getBatcher()
Description copied from interface: org.hibernate.engine.SessionImplementor
Get the prepared statement Batcher for this session

Specified by:
getBatcher in interface org.hibernate.engine.SessionImplementor

getTimestamp

public long getTimestamp()
Description copied from interface: org.hibernate.engine.SessionImplementor
System time before the start of the transaction

Specified by:
getTimestamp in interface org.hibernate.engine.SessionImplementor

close

public java.sql.Connection close()
                          throws org.hibernate.HibernateException
Description copied from interface: org.hibernate.Session
End the Session by disconnecting from the JDBC connection and cleaning up. It is not strictly necessary to close() the Session but you must at least disconnect() it.

Specified by:
close in interface org.hibernate.Session

getConnectionReleaseMode

public org.hibernate.ConnectionReleaseMode getConnectionReleaseMode()
Specified by:
getConnectionReleaseMode in interface org.hibernate.jdbc.JDBCContext.Context

isAutoCloseSessionEnabled

public boolean isAutoCloseSessionEnabled()
Specified by:
isAutoCloseSessionEnabled in interface org.hibernate.jdbc.JDBCContext.Context

isOpen

public boolean isOpen()
Description copied from interface: org.hibernate.Session
Check if the Session is still open.

Specified by:
isOpen in interface org.hibernate.engine.SessionImplementor