Top Fields Constructors Methods
org.hibernate.impl

public Class StatelessSessionImpl

extends AbstractSessionImpl
implements Context, StatelessSession
Class Inheritance
All Implemented Interfaces
org.hibernate.StatelessSession, java.io.Serializable, org.hibernate.jdbc.JDBCContext.Context, org.hibernate.transaction.TransactionFactory.Context
Imports
java.io.Serializable, java.sql.Connection, java.util.Collections, .Iterator, .List, .Map, .Set, org.slf4j.Logger, .LoggerFactory, org.hibernate.CacheMode, .ConnectionReleaseMode, .Criteria, .EmptyInterceptor, .EntityMode, .FlushMode, .HibernateException, .Interceptor, .LockMode, .MappingException, .ScrollMode, .ScrollableResults, .SessionException, .StatelessSession, .Transaction, .UnresolvableObjectException, org.hibernate.cache.CacheKey, org.hibernate.collection.PersistentCollection, org.hibernate.engine.EntityKey, .PersistenceContext, .QueryParameters, .StatefulPersistenceContext, .Versioning, .LoadQueryInfluencers, .NonFlushedChanges, org.hibernate.engine.query.HQLQueryPlan, .NativeSQLQueryPlan, org.hibernate.engine.query.sql.NativeSQLQuerySpecification, org.hibernate.event.EventListeners, org.hibernate.id.IdentifierGeneratorHelper, org.hibernate.jdbc.Batcher, .JDBCContext, org.hibernate.loader.criteria.CriteriaLoader, org.hibernate.loader.custom.CustomLoader, .CustomQuery, org.hibernate.persister.entity.EntityPersister, .OuterJoinLoadable, org.hibernate.pretty.MessageHelper, org.hibernate.proxy.HibernateProxy, org.hibernate.type.Type, org.hibernate.util.CollectionHelper

Author
Gavin King

Field Summary

Modifier and TypeField and Description
private JDBCContext
private static final Logger
private PersistenceContext
Inherited from org.hibernate.impl.AbstractSessionImpl:
factory

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
afterOperation(boolean success)

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 successful, Transaction tx)

Implements org.hibernate.jdbc.JDBCContext.Context.afterTransactionCompletion, org.hibernate.engine.SessionImplementor.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)

public void
public Transaction
beginTransaction()

Implements org.hibernate.StatelessSession.beginTransaction.

Begin a Hibernate transaction.
public String
bestGuessEntityName(Object object)

Implements org.hibernate.engine.SessionImplementor.bestGuessEntityName.

The best guess entity name for an entity not in an association
public void
close()

Implements org.hibernate.StatelessSession.close.

Close the stateless session and release the JDBC connection.
public Connection
connection()

Implements org.hibernate.StatelessSession.connection, org.hibernate.engine.SessionImplementor.connection.

Returns the current JDBC connection associated with this instance.
public Criteria
createCriteria(Class<T>
a class, which is persistent, or has persistent subclasses
persistentClass
,
String alias)

Implements org.hibernate.StatelessSession.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.StatelessSession.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.StatelessSession.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.StatelessSession.createCriteria.

Create a new Criteria instance, for the given entity name.
public void
delete(Object
a detached entity instance
entity
)

Implements org.hibernate.StatelessSession.delete.

Delete a row.
public void
delete(String
The entityName for the entity to be deleted
entityName
,
Object
a detached entity instance
entity
)

Implements org.hibernate.StatelessSession.delete.

Delete a row.
public int
executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification, 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 void
public Object
get(Class<T> entityClass, Serializable id)

Implements org.hibernate.StatelessSession.get.

Retrieve a row.
public Object
get(Class<T> entityClass, Serializable id, LockMode lockMode)

Implements org.hibernate.StatelessSession.get.

Retrieve a row, obtaining the specified lock mode.
public Object
get(String entityName, Serializable id)

Implements org.hibernate.StatelessSession.get.

Retrieve a row.
public Object
get(String entityName, Serializable id, LockMode lockMode)

Implements org.hibernate.StatelessSession.get.

Retrieve a row, obtaining the specified lock mode.
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.

Return the identifier of the persistent object, or null if not associated with the session
public int
public Map<K, V>
getEnabledFilters()

Implements org.hibernate.engine.SessionImplementor.getEnabledFilters.

Return the currently enabled filters.
public EntityMode
public EntityPersister
getEntityPersister(String
optional entity name
entityName
,
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.
public FlushMode
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 NonFlushedChanges
getNonFlushedChanges()

Implements org.hibernate.engine.SessionImplementor.getNonFlushedChanges.

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

Implements org.hibernate.engine.SessionImplementor.getPersistenceContext.

Get the persistence context 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.StatelessSession.getTransaction.

Get the current Hibernate transaction.
public String
guessEntityName(Object entity)

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 an instance immediately.
public void
initializeCollection(PersistentCollection collection, boolean writing)

Implements org.hibernate.engine.SessionImplementor.initializeCollection.

Initialize the collection (if not already initialized)
public Serializable
insert(Object
a new transient instance
entity
)

Implements org.hibernate.StatelessSession.insert.

Insert a row.
public Serializable
insert(String
The entityName for the entity to be inserted
entityName
,
Object
a new transient instance
entity
)

Implements org.hibernate.StatelessSession.insert.

Insert a row.
public Object
instantiate(String entityName, Serializable id)

Implements org.hibernate.engine.SessionImplementor.instantiate.

Instantiate the entity class, initializing with the given identifier
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
public boolean
public boolean
public boolean
public boolean
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 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
public void
public void
refresh(Object
The entity to be refreshed.
entity
)

Implements org.hibernate.StatelessSession.refresh.

Refresh the entity instance state from the database.
public void
refresh(String
The entityName for the entity to be refreshed.
entityName
,
Object
The entity to be refreshed.
entity
)

Implements org.hibernate.StatelessSession.refresh.

Refresh the entity instance state from the database.
public void
refresh(Object
The entity to be refreshed.
entity
,
LockMode
The LockMode to be applied.
lockMode
)

Implements org.hibernate.StatelessSession.refresh.

Refresh the entity instance state from the database.
public void
refresh(String
The entityName for the entity to be refreshed.
entityName
,
Object
The entity to be refreshed.
entity
,
LockMode
The LockMode to be applied.
lockMode
)

Implements org.hibernate.StatelessSession.refresh.

Refresh the entity instance state from the database.
public void
public ScrollableResults
scroll(CriteriaImpl criteria, ScrollMode scrollMode)

Implements org.hibernate.engine.SessionImplementor.scroll.

Execute a criteria query
public ScrollableResults
scroll(String query, QueryParameters queryParameters)

Implements org.hibernate.engine.SessionImplementor.scroll.

Execute a scroll() query
public ScrollableResults
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 readOnly)

public void
setFetchProfile(String
The internal fetch profile name to use
name
)

Implements org.hibernate.engine.SessionImplementor.setFetchProfile.

Set the current internal fetch profile for this session.
public void
public boolean
public void
update(Object
a detached entity instance
entity
)

Implements org.hibernate.StatelessSession.update.

Update a row.
public void
update(String
The entityName for the entity to be updated
entityName
,
Object
a detached entity instance
entity
)

Implements org.hibernate.StatelessSession.update.

Update a row.
public boolean
Inherited from org.hibernate.impl.AbstractSessionImpl:
createQuerycreateSQLQueryerrorIfClosedgetFactorygetHQLQueryPlangetNamedQuerygetNamedSQLQuerygetNativeSQLQueryPlanisClosedlistscrollsetClosed