Top Description Inners Fields Constructors Methods
org.hibernate.impl

public final Class SessionImpl

extends AbstractSessionImpl
implements EventSource, Session, Context, LobCreationContext
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.jdbc.LobCreationContext, org.hibernate.jdbc.JDBCContext.Context, org.hibernate.transaction.TransactionFactory.Context, org.hibernate.classic.Session, org.hibernate.Session, java.io.Serializable, org.hibernate.event.EventSource, org.hibernate.engine.SessionImplementor
Imports
java.io.IOException, .InputStream, .ObjectInputStream, .ObjectOutputStream, .Reader, .Serializable, .ByteArrayOutputStream, .ByteArrayInputStream, java.sql.Blob, .Clob, .Connection, .SQLException, java.util.ArrayList, .Collection, .Collections, .HashMap, .HashSet, .Iterator, .List, .Map, .Set, org.slf4j.Logger, .LoggerFactory, org.hibernate.CacheMode, .ConnectionReleaseMode, .Criteria, .EntityMode, .Filter, .FlushMode, .HibernateException, .Interceptor, .LobHelper, .LockMode, .MappingException, .ObjectDeletedException, .Query, .QueryException, .ReplicationMode, .SQLQuery, .ScrollMode, .ScrollableResults, .Session, .SessionException, .SessionFactory, .Transaction, .TransientObjectException, .TypeHelper, .UnresolvableObjectException, .UnknownProfileException, .EntityNameResolver, .LockOptions, org.hibernate.collection.PersistentCollection, org.hibernate.engine.ActionQueue, .CollectionEntry, .EntityEntry, .EntityKey, .NonFlushedChanges, .PersistenceContext, .QueryParameters, .StatefulPersistenceContext, .Status, .LoadQueryInfluencers, org.hibernate.engine.jdbc.LobCreationContext, .LobCreator, org.hibernate.engine.query.FilterQueryPlan, .HQLQueryPlan, .NativeSQLQueryPlan, org.hibernate.engine.query.sql.NativeSQLQuerySpecification, org.hibernate.event.AutoFlushEvent, .AutoFlushEventListener, .DeleteEvent, .DeleteEventListener, .DirtyCheckEvent, .DirtyCheckEventListener, .EventListeners, .EventSource, .EvictEvent, .EvictEventListener, .FlushEvent, .FlushEventListener, .InitializeCollectionEvent, .InitializeCollectionEventListener, .LoadEvent, .LoadEventListener, .LoadEventListener.LoadType, .LockEvent, .LockEventListener, .MergeEvent, .MergeEventListener, .PersistEvent, .PersistEventListener, .RefreshEvent, .RefreshEventListener, .ReplicateEvent, .ReplicateEventListener, .SaveOrUpdateEvent, .SaveOrUpdateEventListener, org.hibernate.exception.JDBCExceptionHelper, org.hibernate.jdbc.Batcher, .JDBCContext, .Work, org.hibernate.loader.criteria.CriteriaLoader, org.hibernate.loader.custom.CustomLoader, .CustomQuery, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, .OuterJoinLoadable, org.hibernate.pretty.MessageHelper, org.hibernate.proxy.HibernateProxy, .LazyInitializer, org.hibernate.stat.SessionStatistics, .SessionStatisticsImpl, org.hibernate.type.Type, .SerializationException, org.hibernate.util.ArrayHelper, .CollectionHelper, .StringHelper

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.
Author
Gavin King

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class
private class

Field Summary

Modifier and TypeField and Description
private transient ActionQueue
private transient boolean
private transient boolean
private transient CacheMode
private transient Map<K, V>
private transient ConnectionReleaseMode
private transient int
private transient EntityMode
private transient EntityNameResolver
private transient boolean
private transient FlushMode
private transient Interceptor
private transient JDBCContext
private transient EventListeners
private transient LoadQueryInfluencers
private transient SessionImpl.LobHelperImpl
private static final Logger
private transient StatefulPersistenceContext
private transient Session
private transient long
Inherited from org.hibernate.impl.AbstractSessionImpl:
factory

Constructor Summary

AccessConstructor and Description
private
SessionImpl(SessionImpl
The parent session
parent
,
EntityMode entityMode)

Constructor used in building "child sessions".

pack-priv
SessionImpl(final Connection
The user-supplied connection to use for this session.
connection
,
final SessionFactoryImpl
The factory from which this session was obtained
factory
,
final boolean
NOT USED
autoclose
,
final long
The timestamp for this session
timestamp
,
final Interceptor
The interceptor to be applied to this session
interceptor
,
final EntityMode
The entity-mode for this session
entityMode
,
final boolean
Should we auto flush before completion of transaction
flushBeforeCompletionEnabled
,
final boolean
Should we auto close after completion of transaction
autoCloseSessionEnabled
,
final ConnectionReleaseMode
The mode by which we should release JDBC connections.
connectionReleaseMode
)

Constructor used for openSession(...) processing, as well as construction of sessions for getCurrentSession().

Method Summary

Modifier and TypeMethod and Description
public 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

public void
public void
afterTransactionBegin(Transaction tx)

Implements org.hibernate.jdbc.JDBCContext.Context.afterTransactionBegin.

We cannot rely upon this method being called!
public void
afterTransactionCompletion(boolean success, Transaction tx)

Implements org.hibernate.engine.SessionImplementor.afterTransactionCompletion, org.hibernate.jdbc.JDBCContext.Context.afterTransactionCompletion.

Notify the session that the transaction completed, so we no longer own the old locks.
public void
applyNonFlushedChanges(NonFlushedChanges
the non-flushed changes
nonFlushedChanges
)

Implements org.hibernate.engine.SessionImplementor.applyNonFlushedChanges.

Apply non-flushed changes from a different session to this session.
protected boolean
autoFlushIfRequired(Set<E> querySpaces)

detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flush

public void
public Transaction
beginTransaction()

Implements org.hibernate.Session.beginTransaction.

Begin a unit of work and return the associated Transaction object.
public String
bestGuessEntityName(Object object)

Implements org.hibernate.engine.SessionImplementor.bestGuessEntityName.

The best guess entity name for an entity not in an association
public Session.LockRequest
buildLockRequest(LockOptions
contains the lock level
lockOptions
)

Implements org.hibernate.Session.buildLockRequest.

Build a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope.
public void
cancelQuery()

Implements org.hibernate.Session.cancelQuery.

Cancel the execution of the current query.
private void
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

public void
clear()

Implements org.hibernate.Session.clear.

Completely clear the session.
public Connection
close()

Implements org.hibernate.Session.close.

End the session by releasing the JDBC connection and cleaning up.
public Connection
public boolean
contains(Object
an instance of a persistent class
object
)

Implements org.hibernate.Session.contains.

Check if this instance is associated with this Session.
public Criteria
createCriteria(Class<T>
a class, which is persistent, or has persistent subclasses
persistentClass
,
String alias)

Implements org.hibernate.Session.createCriteria.

Create a new Criteria instance, for the given entity class, or a superclass of an entity class, with the given alias.
public Criteria
createCriteria(String entityName, String alias)

Implements org.hibernate.Session.createCriteria.

Create a new Criteria instance, for the given entity name, with the given alias.
public Criteria
createCriteria(Class<T>
a class, which is persistent, or has persistent subclasses
persistentClass
)

Implements org.hibernate.Session.createCriteria.

Create a new Criteria instance, for the given entity class, or a superclass of an entity class.
public Criteria
createCriteria(String entityName)

Implements org.hibernate.Session.createCriteria.

Create a new Criteria instance, for the given entity name.
public Query
createFilter(Object
a persistent collection
collection
,
String
a Hibernate query
queryString
)

Implements org.hibernate.Session.createFilter.

Create a new instance of Query for the given collection and filter string.
public Query
createQuery(String
a HQL query
queryString
)

Overrides org.hibernate.impl.AbstractSessionImpl.createQuery.

Implements org.hibernate.Session.createQuery.

Create a new instance of Query for the given HQL query string.
public SQLQuery
createSQLQuery(String
a SQL query
sql
)

Overrides org.hibernate.impl.AbstractSessionImpl.createSQLQuery.

Implements org.hibernate.Session.createSQLQuery.

Create a new instance of SQLQuery for the given SQL query string.
public Query
createSQLQuery(String
a query expressed in SQL
sql
,
String
a table alias that appears inside {} in the SQL string
returnAlias
,
Class<T>
the returned persistent class
returnClass
)

Implements org.hibernate.classic.Session.createSQLQuery.

Create a new instance of Query for the given SQL string.
public Query
createSQLQuery(String
a query expressed in SQL
sql
,
String[]
an array of table aliases that appear inside {} in the SQL string
returnAliases
,
Class<T>[]
the returned persistent classes
returnClasses
)

Implements org.hibernate.classic.Session.createSQLQuery.

Create a new instance of Query for the given SQL string.
public void
delete(Object
the instance to be removed
object
)

Implements org.hibernate.Session.delete.

Delete a persistent object
public void
delete(String
The entity name for the instance to be removed.
entityName
,
Object
the instance to be removed
object
)

Implements org.hibernate.Session.delete.

Delete a persistent object (by explicit entity name)
public void
delete(String entityName, Object object, boolean isCascadeDeleteEnabled, Set<E> transientEntities)

Implements org.hibernate.event.EventSource.delete.

Delete a persistent object
public int
delete(String
the query string
query
)

Implements org.hibernate.classic.Session.delete.

Delete all objects returned by the query.
public int
delete(String
the query string
query
,
Object
a value to be witten to a "?" placeholder in the query string.
value
,
Type
the hibernate type of value.
type
)

Implements org.hibernate.classic.Session.delete.

Delete all objects returned by the query.
public int
delete(String
the query string
query
,
Object[]
a list of values to be written to "?" placeholders in the query.
values
,
Type[]
a list of Hibernate types of the values
types
)

Implements org.hibernate.classic.Session.delete.

Delete all objects returned by the query.
public void
disableFetchProfile(String
The name of the fetch profile to be disabled.
name
)

Implements org.hibernate.Session.disableFetchProfile.

Disable a particular fetch profile on this session.
public void
disableFilter(String
The name of the filter to be disabled.
filterName
)

Implements org.hibernate.Session.disableFilter.

Disable the named filter for the current session.
public Connection
disconnect()

Implements org.hibernate.Session.disconnect.

Disconnect the Session from the current JDBC connection.
public void
doWork(Work
The work to be performed.
work
)

Implements org.hibernate.Session.doWork.

Controller for allowing users to perform JDBC related work using the Connection managed by this Session.
public void
enableFetchProfile(String
The name of the fetch profile to be enabled.
name
)

Implements org.hibernate.Session.enableFetchProfile.

Enable a particular fetch profile on this session.
public Filter
enableFilter(String
The name of the filter to be enabled.
filterName
)

Implements org.hibernate.Session.enableFilter.

Enable the named filter for this current session.
public void
evict(Object
a persistent instance
object
)

Implements org.hibernate.Session.evict.

remove any hard references to the entity that are held by the infrastructure (references held by application or other persistant instances are okay)
public Object
execute(LobCreationContext.Callback
The callback to execute .
callback
)

Implements org.hibernate.engine.jdbc.LobCreationContext.execute.

Execute the given callback, making sure it has access to a viable JDBC Connection.
public int
executeNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.executeNativeUpdate.

Execute a native SQL update or delete query
public int
executeUpdate(String query, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.executeUpdate.

Execute a HQL update or delete query
public Collection<E>
filter(Object
a persistent collection to filter
collection
,
String
a filter query string
filter
)

Implements org.hibernate.classic.Session.filter.

Apply a filter to a persistent collection.
public Collection<E>
filter(Object
a persistent collection to filter
collection
,
String
a filter query string
filter
,
Object
a value to be witten to a "?" placeholder in the query string
value
,
Type
the hibernate type of value
type
)

Implements org.hibernate.classic.Session.filter.

Apply a filter to a persistent collection.
public Collection<E>
filter(Object
a persistent collection to filter
collection
,
String
a filter query string
filter
,
Object[]
a list of values to be written to "?" placeholders in the query
values
,
Type[]
a list of Hibernate types of the values
types
)

Implements org.hibernate.classic.Session.filter.

Apply a filter to a persistent collection.
public List<E>
find(String
a query expressed in Hibernate's query language
query
)

Implements org.hibernate.classic.Session.find.

Retrieve a list of persistent objects using a hibernate query
public List<E>
find(String
the query string
query
,
Object
a value to be bound to a "?" placeholder (JDBC IN parameter).
value
,
Type
the Hibernate type of the value
type
)

Implements org.hibernate.classic.Session.find.

Execute a query with bind parameters, binding a value to a "?" parameter in the query string.
public List<E>
find(String
the query string
query
,
Object[]
an array of values to be bound to the "?" placeholders (JDBC IN parameters).
values
,
Type[]
an array of Hibernate types of the values
types
)

Implements org.hibernate.classic.Session.find.

Execute a query with bind parameters, binding an array of values to "?" parameters in the query string.
private void
private void
fireDelete(DeleteEvent event, Set<E> transientEntities)

private void
fireEvict(EvictEvent evictEvent)

private void
private void
fireLock(String entityName, Object object, LockOptions options)

private void
fireLock(Object object, LockOptions options)

private void
fireLock(LockEvent lockEvent)

private Object
private void
fireMerge(Map<K, V> copiedAlready, MergeEvent event)

private void
firePersist(Map<K, V> copiedAlready, PersistEvent event)

private void
private void
firePersistOnFlush(Map<K, V> copiedAlready, PersistEvent event)

private void
private void
fireRefresh(RefreshEvent refreshEvent)

private void
fireRefresh(Map<K, V> refreshedAlready, RefreshEvent refreshEvent)

private void
private Serializable
private void
private void
fireSaveOrUpdateCopy(Map<K, V> copiedAlready, MergeEvent event)

private Object
private void
public void
public void
forceFlush(EntityEntry entityEntry)

Implements org.hibernate.event.EventSource.forceFlush.

Force an immediate flush
public Object
get(Class<T>
a persistent class
entityClass
,
Serializable
an identifier
id
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public Object
get(String
the entity name
entityName
,
Serializable
an identifier
id
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance.
public Object
get(Class<T>
a persistent class
entityClass
,
Serializable
an identifier
id
,
LockMode
the lock mode
lockMode
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public Object
get(Class<T>
a persistent class
entityClass
,
Serializable
an identifier
id
,
LockOptions
the lock mode
lockOptions
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public Object
get(String
the entity name
entityName
,
Serializable
an identifier
id
,
LockMode
the lock mode
lockMode
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public Object
get(String
the entity name
entityName
,
Serializable
an identifier
id
,
LockOptions
contains the lock mode
lockOptions
)

Implements org.hibernate.Session.get.

Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
public ActionQueue
getActionQueue()

Implements org.hibernate.event.EventSource.getActionQueue.

Get the ActionQueue for this session
public Batcher
getBatcher()

Implements org.hibernate.engine.SessionImplementor.getBatcher.

Get the prepared statement Batcher for this session
public CacheMode
public ConnectionReleaseMode
public Serializable
getContextEntityIdentifier(Object object)

Implements org.hibernate.engine.SessionImplementor.getContextEntityIdentifier.

Get the id value for an object that is actually associated with the session.
public LockMode
getCurrentLockMode(Object
a persistent instance
object
)

Implements org.hibernate.Session.getCurrentLockMode.

Determine the current lock mode of the given object.
public int
public Filter
getEnabledFilter(String
The name of the filter to be retrieved.
filterName
)

Implements org.hibernate.Session.getEnabledFilter.

Retrieve a currently enabled filter by name.
public Map<K, V>
getEnabledFilters()

Implements org.hibernate.engine.SessionImplementor.getEnabledFilters.

Return the currently enabled filters.
public EntityMode
getEntityMode()

Implements org.hibernate.engine.SessionImplementor.getEntityMode, org.hibernate.Session.getEntityMode.

Retrieve the entity mode in effect for this session.
public String
getEntityName(Object
a persistent entity
object
)

Implements org.hibernate.Session.getEntityName.

Return the entity name for a persistent entity
public EntityPersister
getEntityPersister(final String
optional entity name
entityName
,
final Object
the entity instance
object
)

Implements org.hibernate.engine.SessionImplementor.getEntityPersister.

Get the EntityPersister for any instance
public Object
getEntityUsingInterceptor(EntityKey key)

Implements org.hibernate.engine.SessionImplementor.getEntityUsingInterceptor.

Get the entity instance associated with the given Key, calling the Interceptor if necessary
public String
getFetchProfile()

Implements org.hibernate.engine.SessionImplementor.getFetchProfile.

Get the internal fetch profile currently associated with this session.
public Type
getFilterParameterType(String
The filter parameter name in the format {FILTER_NAME.PARAMETER_NAME}.
filterParameterName
)

Implements org.hibernate.engine.SessionImplementor.getFilterParameterType.

Retreive the type for a given filter parrameter.
public Object
getFilterParameterValue(String
The filter parameter name in the format {FILTER_NAME.PARAMETER_NAME}.
filterParameterName
)

Implements org.hibernate.engine.SessionImplementor.getFilterParameterValue.

Retreive the currently set value for a filter parameter.
private FilterQueryPlan
getFilterQueryPlan(Object collection, String filter, QueryParameters parameters, boolean shallow)

public FlushMode
public Serializable
getIdentifier(Object
a persistent instance
object
)

Implements org.hibernate.Session.getIdentifier.

Return the identifier value of the given entity as associated with this session.
public Interceptor
getInterceptor()

Implements org.hibernate.engine.SessionImplementor.getInterceptor.

Retrieves the interceptor currently in use by this event source.
public JDBCContext
public EventListeners
getListeners()

Implements org.hibernate.engine.SessionImplementor.getListeners.

Retrieves the configured event listeners from this event source.
public LoadQueryInfluencers
getLoadQueryInfluencers()

Implements org.hibernate.engine.SessionImplementor.getLoadQueryInfluencers.

Get the load query influencers associated with this session.
public LobHelper
getLobHelper()

Implements org.hibernate.Session.getLobHelper.

Retrieve this session's helper/delegate for creating LOB instances.
public Query
getNamedQuery(String
the name of a query defined externally
queryName
)

Overrides org.hibernate.impl.AbstractSessionImpl.getNamedQuery.

Implements org.hibernate.engine.SessionImplementor.getNamedQuery, org.hibernate.Session.getNamedQuery.

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

Returns:

The non-flushed changes.
getNonFlushedChanges
()

Implements org.hibernate.engine.SessionImplementor.getNonFlushedChanges.

Return changes to this session and its child sessions that have not been flushed yet.
private OuterJoinLoadable
public PersistenceContext
getPersistenceContext()

Implements org.hibernate.engine.SessionImplementor.getPersistenceContext.

Get the persistence context for this session
private Serializable
public Session
getSession(EntityMode
The entity mode to use for the new session.
entityMode
)

Implements org.hibernate.Session.getSession.

Starts a new Session with the given entity mode in effect.
public SessionFactory
getSessionFactory()

Implements org.hibernate.Session.getSessionFactory.

Get the session factory which created this session.
public SessionStatistics
getStatistics()

Implements org.hibernate.Session.getStatistics.

Get the statistics for this session.
public long
getTimestamp()

Implements org.hibernate.engine.SessionImplementor.getTimestamp.

System time before the start of the transaction
public Transaction
getTransaction()

Implements org.hibernate.Session.getTransaction.

Get the Transaction instance associated with this session.
public TypeHelper
getTypeHelper()

Implements org.hibernate.Session.getTypeHelper.

Convenience access to the TypeHelper associated with this session's SessionFactory.
public String
guessEntityName(Object object)

Implements org.hibernate.engine.SessionImplementor.guessEntityName.

The guessed entity name for an entity not in an association
public Object
immediateLoad(String entityName, Serializable id)

Implements org.hibernate.engine.SessionImplementor.immediateLoad.

Load the data for the object with the specified id into a newly created object.
public void
initializeCollection(PersistentCollection collection, boolean writing)

Implements org.hibernate.engine.SessionImplementor.initializeCollection.

Initialize the collection (if not already initialized)
public Object
instantiate(String entityName, Serializable id)

Implements org.hibernate.engine.SessionImplementor.instantiate.

Instantiate the entity class, initializing with the given identifier
public Object
instantiate(EntityPersister persister, Serializable id)

Implements org.hibernate.event.EventSource.instantiate.

give the interceptor an opportunity to override the default instantiation
public Object
internalLoad(String entityName, Serializable id, boolean eager, boolean nullable)

Implements org.hibernate.engine.SessionImplementor.internalLoad.

Load an instance without checking if it was deleted.
public boolean
public boolean
public boolean
isDefaultReadOnly()

Implements org.hibernate.Session.isDefaultReadOnly.

Will entities and proxies that are loaded into this session be made read-only by default?
public boolean
isDirty()

Implements org.hibernate.Session.isDirty.

Does this session contain any changes which must be synchronized with the database?
public boolean
public boolean
isFetchProfileEnabled(String
The name of the profile to be checked.
name
)

Implements org.hibernate.Session.isFetchProfileEnabled.

Is a particular fetch profile enabled on this session?
public boolean
public boolean
public boolean
public boolean
isReadOnly(Object
an entity or HibernateProxy
entityOrProxy
)

Implements org.hibernate.Session.isReadOnly.

Is the specified entity or proxy read-only?
public boolean
isTransactionInProgress()

Implements org.hibernate.engine.SessionImplementor.isTransactionInProgress.

Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?
public Iterator<E>
iterate(String
the query string
query
)

Implements org.hibernate.classic.Session.iterate.

Execute a query and return the results in an iterator.
public Iterator<E>
iterate(String
the query string
query
,
Object
a value to be witten to a "?" placeholder in the query string
value
,
Type
the hibernate type of value
type
)

Implements org.hibernate.classic.Session.iterate.

Execute a query and return the results in an iterator.
public Iterator<E>
iterate(String
the query string
query
,
Object[]
a list of values to be written to "?" placeholders in the query
values
,
Type[]
a list of Hibernate types of the values
types
)

Implements org.hibernate.classic.Session.iterate.

Execute a query and return the results in an iterator.
public Iterator<E>
iterate(String query, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.iterate.

Execute an iterate() query
public Iterator<E>
iterateFilter(Object collection, String filter, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.iterateFilter.

Iterate a filter
public List<E>
list(String query, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.list.

Execute a find() query
public List<E>
list(CriteriaImpl criteria)

Implements org.hibernate.engine.SessionImplementor.list.

Execute a criteria query
public List<E>
listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.listCustomQuery.

Execute an SQL Query
public List<E>
listFilter(Object collection, String filter, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.listFilter.

Execute a filter
public void
load(Object
an "empty" instance of the persistent class
object
,
Serializable
a valid identifier of an existing persistent instance of the class
id
)

Implements org.hibernate.Session.load.

Read the persistent state associated with the given identifier into the given transient instance.
public Object
load(Class<T>
a persistent class
entityClass
,
Serializable
a valid identifier of an existing persistent instance of the class
id
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.
public Object
load(String
a persistent class
entityName
,
Serializable
a valid identifier of an existing persistent instance of the class
id
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.
public Object
load(Class<T>
a persistent class
entityClass
,
Serializable
a valid identifier of an existing persistent instance of the class
id
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
public Object
load(Class<T>
a persistent class
entityClass
,
Serializable
a valid identifier of an existing persistent instance of the class
id
,
LockOptions
contains the lock level
lockOptions
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
public Object
load(String
a persistent class
entityName
,
Serializable
a valid identifier of an existing persistent instance of the class
id
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
public Object
load(String
a persistent class
entityName
,
Serializable
a valid identifier of an existing persistent instance of the class
id
,
LockOptions
contains the lock level
lockOptions
)

Implements org.hibernate.Session.load.

Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
public void
lock(String entityName, Object
a persistent or transient instance
object
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.lock.

Obtain the specified lock level upon the given object.
public void
lock(Object
a persistent or transient instance
object
,
LockMode
the lock level
lockMode
)

Implements org.hibernate.Session.lock.

Obtain the specified lock level upon the given object.
public void
public void
public Object
merge(String entityName, Object
a detached instance with state to be copied
object
)

Implements org.hibernate.Session.merge.

Copy the state of the given object onto the persistent object with the same identifier.
public Object
merge(Object
a detached instance with state to be copied
object
)

Implements org.hibernate.Session.merge.

Copy the state of the given object onto the persistent object with the same identifier.
public void
merge(String entityName, Object object, Map<K, V> copiedAlready)

Implements org.hibernate.event.EventSource.merge.

Cascade merge an entity instance
public void
persist(String entityName, Object
a transient instance to be made persistent
object
)

Implements org.hibernate.Session.persist.

Make a transient instance persistent.
public void
persist(Object
a transient instance to be made persistent
object
)

Implements org.hibernate.Session.persist.

Make a transient instance persistent.
public void
persist(String entityName, Object object, Map<K, V> copiedAlready)

Implements org.hibernate.event.EventSource.persist.

Cascade persist an entity instance
public void
persistOnFlush(String entityName, Object object)

public void
public void
persistOnFlush(String entityName, Object object, Map<K, V> copiedAlready)

Implements org.hibernate.event.EventSource.persistOnFlush.

Cascade persist an entity instance during the flush process
private void
readObject(ObjectInputStream
The input stream from which we are being read...
ois
)

Used by JDK serialization...

public void
reconnect()

Implements org.hibernate.Session.reconnect.

Obtain a new JDBC connection.
public void
reconnect(Connection
a JDBC connection
conn
)

Implements org.hibernate.Session.reconnect.

Reconnect to the given JDBC connection.
public void
refresh(Object
a persistent or detached instance
object
)

Implements org.hibernate.Session.refresh.

Re-read the state of the given instance from the underlying database.
public void
refresh(Object
a persistent or detached instance
object
,
LockMode
the lock mode to use
lockMode
)

Implements org.hibernate.Session.refresh.

Re-read the state of the given instance from the underlying database, with the given LockMode.
public void
refresh(Object
a persistent or detached instance
object
,
LockOptions
contains the lock mode to use
lockOptions
)

Implements org.hibernate.Session.refresh.

Re-read the state of the given instance from the underlying database, with the given LockMode.
public void
refresh(Object object, Map<K, V> refreshedAlready)

Implements org.hibernate.event.EventSource.refresh.

Cascade refesh an entity instance
private void
private void
public void
replicate(Object
a detached instance of a persistent class
obj
,
ReplicationMode replicationMode)

Implements org.hibernate.Session.replicate.

Persist the state of the given detached instance, reusing the current identifier value.
public void
replicate(String entityName, Object
a detached instance of a persistent class
obj
,
ReplicationMode replicationMode)

Implements org.hibernate.Session.replicate.

Persist the state of the given detached instance, reusing the current identifier value.
public void
save(Object
a transient instance of a persistent class
obj
,
Serializable
an unused valid identifier
id
)

Implements org.hibernate.classic.Session.save.

Persist the given transient instance, using the given identifier.
public Serializable
save(Object
a transient instance of a persistent class
obj
)

Implements org.hibernate.Session.save.

Persist the given transient instance, first assigning a generated identifier.
public Serializable
save(String entityName, Object
a transient instance of a persistent class
object
)

Implements org.hibernate.Session.save.

Persist the given transient instance, first assigning a generated identifier.
public void
save(String entityName, Object
a transient instance of a persistent class
object
,
Serializable
an unused valid identifier
id
)

Implements org.hibernate.classic.Session.save.

Persist the given transient instance, using the given identifier.
public void
saveOrUpdate(Object
a transient or detached instance containing new or updated state
object
)

Implements org.hibernate.Session.saveOrUpdate.

Either save(Object) or update(Object) the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking).
public void
saveOrUpdate(String entityName, Object
a transient or detached instance containing new or updated state
obj
)

Implements org.hibernate.Session.saveOrUpdate.

Either save(String, Object) or update(String, Object) the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking).
public Object
saveOrUpdateCopy(String entityName, Object
a transient instance with state to be copied
object
)

Implements org.hibernate.classic.Session.saveOrUpdateCopy.

Copy the state of the given object onto the persistent object with the same identifier.
public Object
saveOrUpdateCopy(Object
a transient instance with state to be copied
object
)

Implements org.hibernate.classic.Session.saveOrUpdateCopy.

Copy the state of the given object onto the persistent object with the same identifier.
public Object
saveOrUpdateCopy(String entityName, Object
a persistent or transient instance with state to be copied
object
,
Serializable
the identifier of the instance to copy to
id
)

Implements org.hibernate.classic.Session.saveOrUpdateCopy.

Copy the state of the given object onto the persistent object with the given identifier.
public Object
saveOrUpdateCopy(Object
a persistent or transient instance with state to be copied
object
,
Serializable
the identifier of the instance to copy to
id
)

Implements org.hibernate.classic.Session.saveOrUpdateCopy.

Copy the state of the given object onto the persistent object with the given identifier.
public void
saveOrUpdateCopy(String entityName, Object object, Map<K, V> copiedAlready)

Implements org.hibernate.event.EventSource.saveOrUpdateCopy.

Cascade copy an entity instance
public ScrollableResults
scroll(String query, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.scroll.

Execute a scroll() query
public ScrollableResults
scroll(CriteriaImpl criteria, ScrollMode scrollMode)

Implements org.hibernate.engine.SessionImplementor.scroll.

Execute a criteria query
public ScrollableResults
private static byte[]
private static byte[]
public void
setAutoClear(boolean enabled)

Implements org.hibernate.engine.SessionImplementor.setAutoClear.

Enable/disable automatic cache clearing from after transaction completion (for EJB3)
public void
public void
setDefaultReadOnly(boolean
true, the default for loaded entities/proxies is read-only; false, the default for loaded entities/proxies is modifiable
defaultReadOnly
)

Implements org.hibernate.Session.setDefaultReadOnly.

Change the default for entities and proxies loaded into this session from modifiable to read-only mode, or from modifiable to read-only mode.
public void
setFetchProfile(String
The internal fetch profile name to use
fetchProfile
)

Implements org.hibernate.engine.SessionImplementor.setFetchProfile.

Set the current internal fetch profile for this session.
public void
setFlushMode(FlushMode
the new flush mode
flushMode
)

Implements org.hibernate.engine.SessionImplementor.setFlushMode, org.hibernate.Session.setFlushMode.

Set the flush mode for this session.
public void
setReadOnly(Object
an entity or HibernateProxy
entity
,
boolean
if true, the entity or proxy is made read-only; if false, the entity or proxy is made modifiable.
readOnly
)

Implements org.hibernate.Session.setReadOnly.

Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode.
public boolean
private void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
update(Object
a detached instance containing updated state
obj
)

Implements org.hibernate.Session.update.

Update the persistent instance with the identifier of the given detached instance.
public void
update(Object
a detached instance containing updated state
obj
,
Serializable
identifier of persistent instance
id
)

Implements org.hibernate.classic.Session.update.

Update the persistent state associated with the given identifier.
public void
update(String entityName, Object
a detached instance containing updated state
object
)

Implements org.hibernate.Session.update.

Update the persistent instance with the identifier of the given detached instance.
public void
update(String entityName, Object
a detached instance containing updated state
object
,
Serializable
identifier of persistent instance
id
)

Implements org.hibernate.classic.Session.update.

Update the persistent state associated with the given identifier.
private void
writeObject(ObjectOutputStream
The output stream to which we are being written...
oos
)

Used by JDK serialization...

Inherited from org.hibernate.impl.AbstractSessionImpl:
errorIfClosedgetFactorygetHQLQueryPlangetNamedSQLQuerygetNativeSQLQueryPlanisClosedlistscrollsetClosed