public class

StatelessSessionImpl

extends AbstractSessionImpl
implements StatelessSession JDBCContext.Context
java.lang.Object
   ↳ org.hibernate.impl.AbstractSessionImpl
     ↳ org.hibernate.impl.StatelessSessionImpl

Summary

[Expand]
Inherited Fields
From class org.hibernate.impl.AbstractSessionImpl
Public Methods
void afterOperation(boolean success)
void afterScrollOperation()
void afterTransactionBegin(Transaction tx)
We cannot rely upon this method being called! It is only called if we are using Hibernate Transaction API.
void afterTransactionCompletion(boolean successful, Transaction tx)
void applyNonFlushedChanges(NonFlushedChanges nonFlushedChanges)
void beforeTransactionCompletion(Transaction tx)
Transaction beginTransaction()
Begin a Hibernate transaction.
String bestGuessEntityName(Object object)
void close()
Close the stateless session and release the JDBC connection.
Connection connection()
Returns the current JDBC connection associated with this instance.
Criteria createCriteria(String entityName)
Create a new Criteria instance, for the given entity name.
Criteria createCriteria(String entityName, String alias)
Create a new Criteria instance, for the given entity name, with the given alias.
Criteria createCriteria(Class persistentClass)
Create a new Criteria instance, for the given entity class, or a superclass of an entity class.
Criteria createCriteria(Class persistentClass, String alias)
Create a new Criteria instance, for the given entity class, or a superclass of an entity class, with the given alias.
void delete(String entityName, Object entity)
Delete a row.
void delete(Object entity)
Delete a row.
int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification, QueryParameters queryParameters)
int executeUpdate(String query, QueryParameters queryParameters)
void flush()
Object get(String entityName, Serializable id, LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.
Object get(Class entityClass, Serializable id, LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.
Object get(String entityName, Serializable id)
Retrieve a row.
Object get(Class entityClass, Serializable id)
Retrieve a row.
Batcher getBatcher()
CacheMode getCacheMode()
ConnectionReleaseMode getConnectionReleaseMode()
Serializable getContextEntityIdentifier(Object object)
int getDontFlushFromFind()
Map getEnabledFilters()
EntityMode getEntityMode()
EntityPersister getEntityPersister(String entityName, Object object)
Object getEntityUsingInterceptor(EntityKey key)
String getFetchProfile()
Type getFilterParameterType(String filterParameterName)
Object getFilterParameterValue(String filterParameterName)
FlushMode getFlushMode()
Interceptor getInterceptor()
JDBCContext getJDBCContext()
EventListeners getListeners()
LoadQueryInfluencers getLoadQueryInfluencers()
NonFlushedChanges getNonFlushedChanges()
PersistenceContext getPersistenceContext()
long getTimestamp()
Transaction getTransaction()
Get the current Hibernate transaction.
String guessEntityName(Object entity)
Object immediateLoad(String entityName, Serializable id)
void initializeCollection(PersistentCollection collection, boolean writing)
Serializable insert(String entityName, Object entity)
Insert a row.
Serializable insert(Object entity)
Insert a row.
Object instantiate(String entityName, Serializable id)
Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable)
boolean isAutoCloseSessionEnabled()
boolean isConnected()
boolean isDefaultReadOnly()
boolean isEventSource()
boolean isFlushBeforeCompletionEnabled()
boolean isFlushModeNever()
boolean isOpen()
boolean isTransactionInProgress()
Iterator iterate(String query, QueryParameters queryParameters)
Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters)
List list(String query, QueryParameters queryParameters)
List list(CriteriaImpl criteria)
List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)
List listFilter(Object collection, String filter, QueryParameters queryParameters)
void managedClose()
void managedFlush()
void refresh(String entityName, Object entity)
Refresh the entity instance state from the database.
void refresh(String entityName, Object entity, LockMode lockMode)
Refresh the entity instance state from the database.
void refresh(Object entity, LockMode lockMode)
Refresh the entity instance state from the database.
void refresh(Object entity)
Refresh the entity instance state from the database.
void registerInsertedKey(EntityPersister persister, Serializable id)
ScrollableResults scroll(CriteriaImpl criteria, ScrollMode scrollMode)
ScrollableResults scroll(String query, QueryParameters queryParameters)
ScrollableResults scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)
void setAutoClear(boolean enabled)
void setCacheMode(CacheMode cm)
void setDefaultReadOnly(boolean readOnly)
void setFetchProfile(String name)
void setFlushMode(FlushMode fm)
boolean shouldAutoClose()
void update(Object entity)
Update a row.
void update(String entityName, Object entity)
Update a row.
boolean wasInsertedDuringTransaction(EntityPersister persister, Serializable id)
Protected Methods
boolean autoFlushIfRequired(Set querySpaces)
[Expand]
Inherited Methods
From class org.hibernate.impl.AbstractSessionImpl
From class java.lang.Object
From interface org.hibernate.StatelessSession
From interface org.hibernate.engine.SessionImplementor
From interface org.hibernate.jdbc.JDBCContext.Context
From interface org.hibernate.transaction.TransactionFactory.Context

Public Methods

public void afterOperation (boolean success)

public void afterScrollOperation ()

public void afterTransactionBegin (Transaction tx)

We cannot rely upon this method being called! It is only called if we are using Hibernate Transaction API.

public void afterTransactionCompletion (boolean successful, Transaction tx)

public void applyNonFlushedChanges (NonFlushedChanges nonFlushedChanges)

public void beforeTransactionCompletion (Transaction tx)

public Transaction beginTransaction ()

Begin a Hibernate transaction.

public String bestGuessEntityName (Object object)

public void close ()

Close the stateless session and release the JDBC connection.

public Connection connection ()

Returns the current JDBC connection associated with this instance.

If the session is using aggressive connection release (as in a CMT environment), it is the application's responsibility to close the connection returned by this call. Otherwise, the application should not close the connection.

public Criteria createCriteria (String entityName)

Create a new Criteria instance, for the given entity name. Entities returned by the query are detached.

Returns
  • Criteria

public Criteria createCriteria (String entityName, String alias)

Create a new Criteria instance, for the given entity name, with the given alias. Entities returned by the query are detached.

Returns
  • Criteria

public Criteria createCriteria (Class persistentClass)

Create a new Criteria instance, for the given entity class, or a superclass of an entity class. Entities returned by the query are detached.

Parameters
persistentClass a class, which is persistent, or has persistent subclasses
Returns
  • Criteria

public Criteria createCriteria (Class persistentClass, String alias)

Create a new Criteria instance, for the given entity class, or a superclass of an entity class, with the given alias. Entities returned by the query are detached.

Parameters
persistentClass a class, which is persistent, or has persistent subclasses
Returns
  • Criteria

public void delete (String entityName, Object entity)

Delete a row.

Parameters
entityName The entityName for the entity to be deleted
entity a detached entity instance

public void delete (Object entity)

Delete a row.

Parameters
entity a detached entity instance

public int executeNativeUpdate (NativeSQLQuerySpecification nativeSQLQuerySpecification, QueryParameters queryParameters)

public int executeUpdate (String query, QueryParameters queryParameters)

public void flush ()

public Object get (String entityName, Serializable id, LockMode lockMode)

Retrieve a row, obtaining the specified lock mode.

Returns
  • a detached entity instance

public Object get (Class entityClass, Serializable id, LockMode lockMode)

Retrieve a row, obtaining the specified lock mode.

Returns
  • a detached entity instance

public Object get (String entityName, Serializable id)

Retrieve a row.

Returns
  • a detached entity instance

public Object get (Class entityClass, Serializable id)

Retrieve a row.

Returns
  • a detached entity instance

public Batcher getBatcher ()

public CacheMode getCacheMode ()

public ConnectionReleaseMode getConnectionReleaseMode ()

public Serializable getContextEntityIdentifier (Object object)

public int getDontFlushFromFind ()

public Map getEnabledFilters ()

public EntityMode getEntityMode ()

public EntityPersister getEntityPersister (String entityName, Object object)

public Object getEntityUsingInterceptor (EntityKey key)

public String getFetchProfile ()

public Type getFilterParameterType (String filterParameterName)

public Object getFilterParameterValue (String filterParameterName)

public FlushMode getFlushMode ()

public Interceptor getInterceptor ()

public JDBCContext getJDBCContext ()

public EventListeners getListeners ()

public LoadQueryInfluencers getLoadQueryInfluencers ()

public NonFlushedChanges getNonFlushedChanges ()

public PersistenceContext getPersistenceContext ()

public long getTimestamp ()

public Transaction getTransaction ()

Get the current Hibernate transaction.

public String guessEntityName (Object entity)

public Object immediateLoad (String entityName, Serializable id)

public void initializeCollection (PersistentCollection collection, boolean writing)

public Serializable insert (String entityName, Object entity)

Insert a row.

Parameters
entityName The entityName for the entity to be inserted
entity a new transient instance
Returns
  • the identifier of the instance

public Serializable insert (Object entity)

Insert a row.

Parameters
entity a new transient instance

public Object instantiate (String entityName, Serializable id)

public Object internalLoad (String entityName, Serializable id, boolean eager, boolean nullable)

public boolean isAutoCloseSessionEnabled ()

public boolean isConnected ()

public boolean isDefaultReadOnly ()

public boolean isEventSource ()

public boolean isFlushBeforeCompletionEnabled ()

public boolean isFlushModeNever ()

public boolean isOpen ()

public boolean isTransactionInProgress ()

public Iterator iterate (String query, QueryParameters queryParameters)

public Iterator iterateFilter (Object collection, String filter, QueryParameters queryParameters)

public List list (String query, QueryParameters queryParameters)

public List list (CriteriaImpl criteria)

public List listCustomQuery (CustomQuery customQuery, QueryParameters queryParameters)

public List listFilter (Object collection, String filter, QueryParameters queryParameters)

public void managedClose ()

public void managedFlush ()

public void refresh (String entityName, Object entity)

Refresh the entity instance state from the database.

Parameters
entityName The entityName for the entity to be refreshed.
entity The entity to be refreshed.

public void refresh (String entityName, Object entity, LockMode lockMode)

Refresh the entity instance state from the database.

Parameters
entityName The entityName for the entity to be refreshed.
entity The entity to be refreshed.
lockMode The LockMode to be applied.

public void refresh (Object entity, LockMode lockMode)

Refresh the entity instance state from the database.

Parameters
entity The entity to be refreshed.
lockMode The LockMode to be applied.

public void refresh (Object entity)

Refresh the entity instance state from the database.

Parameters
entity The entity to be refreshed.

public void registerInsertedKey (EntityPersister persister, Serializable id)

public ScrollableResults scroll (CriteriaImpl criteria, ScrollMode scrollMode)

public ScrollableResults scroll (String query, QueryParameters queryParameters)

public ScrollableResults scrollCustomQuery (CustomQuery customQuery, QueryParameters queryParameters)

public void setAutoClear (boolean enabled)

public void setCacheMode (CacheMode cm)

public void setDefaultReadOnly (boolean readOnly)

public void setFetchProfile (String name)

public void setFlushMode (FlushMode fm)

public boolean shouldAutoClose ()

public void update (Object entity)

Update a row.

Parameters
entity a detached entity instance

public void update (String entityName, Object entity)

Update a row.

Parameters
entityName The entityName for the entity to be updated
entity a detached entity instance

public boolean wasInsertedDuringTransaction (EntityPersister persister, Serializable id)

Protected Methods

protected boolean autoFlushIfRequired (Set querySpaces)