Top Fields Constructors Methods
org.hibernate.internal

public Class StatelessSessionImpl

extends AbstractSharedSessionContract
implements StatelessSession
Class Inheritance
All Implemented Interfaces
org.hibernate.StatelessSession, java.io.Closeable, java.lang.AutoCloseable, org.hibernate.SharedSessionContract, java.io.Serializable, org.hibernate.query.QueryProducer
Imports
java.io.Serializable, java.sql.Connection, java.util.Collections, .Iterator, .List, javax.transaction.SystemException, org.hibernate.CacheMode, .Criteria, .EntityMode, .FlushMode, .HibernateException, .LockMode, .MappingException, .ScrollMode, .SessionException, .StatelessSession, .UnresolvableObjectException, org.hibernate.bytecode.spi.BytecodeEnhancementMetadata, org.hibernate.cache.spi.access.EntityDataAccess, org.hibernate.collection.spi.PersistentCollection, org.hibernate.engine.internal.StatefulPersistenceContext, .Versioning, org.hibernate.engine.query.spi.HQLQueryPlan, .NativeSQLQueryPlan, org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification, org.hibernate.engine.spi.EntityKey, .LoadQueryInfluencers, .PersistenceContext, .QueryParameters, org.hibernate.engine.transaction.internal.jta.JtaStatusHelper, org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform, org.hibernate.id.IdentifierGeneratorHelper, 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.query.spi.ScrollableResultsImplementor, org.hibernate.tuple.entity.EntityMetamodel

Authors
Gavin King, Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final boolean
private static final CoreMessageLogger
private static LoadQueryInfluencers
private final PersistenceContext
Inherited from org.hibernate.internal.AbstractSharedSessionContract:
closedfastSessionServiceswaitingForAutoClose

Constructor Summary

AccessConstructor and Description
public
StatelessSessionImpl(SessionFactoryImpl factory, SessionCreationOptions options)

Deprecated as a consequence of SessionFactoryImpl being deprecated.

Method Summary

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

public void
public void
afterTransactionBegin()

Implements org.hibernate.resource.jdbc.spi.JdbcSessionOwner.afterTransactionBegin.

A after-begin callback from the coordinator to its owner.
public void
afterTransactionCompletion(boolean
Was the transaction successful?
successful
,
boolean
Is this a delayed after transaction completion call (aka after a timeout)?
delayed
)

Overrides org.hibernate.internal.AbstractSharedSessionContract.afterTransactionCompletion.

Implements org.hibernate.resource.jdbc.spi.JdbcSessionOwner.afterTransactionCompletion.

An after-completion callback to the owner.
public void
public String
bestGuessEntityName(Object object)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.bestGuessEntityName.

The best guess entity name for an entity not in an association
public Connection
connection()

Implements org.hibernate.StatelessSession.connection, org.hibernate.engine.spi.SharedSessionContractImplementor.connection.

Returns the current JDBC connection associated with this instance.
public Criteria
createCriteria(Class<T>
The class, which is an entity, or has entity subclasses/implementors
persistentClass
,
String
The alias to use
alias
)

Implements org.hibernate.SharedSessionContract.createCriteria.

Create Criteria instance for the given class (entity or subclasses/implementors), using a specific alias.
public Criteria
createCriteria(String
The entity name
entityName
,
String
The alias to use
alias
)

Implements org.hibernate.SharedSessionContract.createCriteria.

Create Criteria instance for the given entity name, using a specific alias.
public Criteria
createCriteria(Class<T>
The class, which is an entity, or has entity subclasses/implementors
persistentClass
)

Implements org.hibernate.SharedSessionContract.createCriteria.

Create Criteria instance for the given class (entity or subclasses/implementors).
public Criteria
createCriteria(String
The entity name
entityName
)

Implements org.hibernate.SharedSessionContract.createCriteria.

Create Criteria instance for the given entity name.
private Object
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.spi.SharedSessionContractImplementor.executeNativeUpdate.

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

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.executeUpdate.

Execute a HQL update or delete query
public void
public void
public Object
get(Class<T>
The class of the entity to retrieve
entityClass
,
Serializable
The id of the entity to retrieve
id
)

Implements org.hibernate.StatelessSession.get.

Retrieve a row.
public Object
get(Class<T>
The class of the entity to retrieve
entityClass
,
Serializable
The id of the entity to retrieve
id
,
LockMode
The lock mode to apply to the entity
lockMode
)

Implements org.hibernate.StatelessSession.get.

Retrieve a row, obtaining the specified lock mode.
public Object
get(String
The name of the entity to retrieve
entityName
,
Serializable
The id of the entity to retrieve
id
)

Implements org.hibernate.StatelessSession.get.

Retrieve a row.
public Object
get(String
The name of the entity to retrieve
entityName
,
Serializable
The id of the entity to retrieve
id
,
LockMode
The lock mode to apply to the entity
lockMode
)

Implements org.hibernate.StatelessSession.get.

Retrieve a row, obtaining the specified lock mode.
public CacheMode
public Serializable
getContextEntityIdentifier(Object object)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getContextEntityIdentifier.

Return the identifier of the persistent object, or null if not associated with the session
public int
public EntityMode
public EntityPersister
getEntityPersister(String
optional entity name
entityName
,
Object
the entity instance
object
)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getEntityPersister.

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

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getEntityUsingInterceptor.

Get the entity instance associated with the given Key, calling the Interceptor if necessary
private JtaPlatform
public LoadQueryInfluencers
getLoadQueryInfluencers()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getLoadQueryInfluencers.

Get the load query influencers associated with this session.
private LockMode
private OuterJoinLoadable
public PersistenceContext
public PersistenceContext
getPersistenceContextInternal()

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.getPersistenceContextInternal.

This is similar to getPersistenceContext(), with two main differences: a) this version performs better as it allows for inlining and probably better prediction b) see SessionImplgetPersistenceContext() : it does some checks on the current state of the Session.
public String
guessEntityName(Object entity)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.guessEntityName.

The guessed entity name for an entity not in an association
public Object
public void
initializeCollection(PersistentCollection collection, boolean writing)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.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.spi.SharedSessionContractImplementor.instantiate.

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

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.instantiate.

Instantiate the entity class of an EntityPersister, initializing with the given identifier.
public Object
internalLoad(String entityName, Serializable id, boolean eager, boolean nullable)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.internalLoad.

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

Overrides org.hibernate.internal.AbstractSharedSessionContract.isTransactionInProgress.

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.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.spi.SharedSessionContractImplementor.iterate.

Execute an iterate() query
public Iterator<E>
public List<E>
list(String query, QueryParameters queryParameters)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.list.

Execute a find() query
public List<E>
public List<E>
public List<E>
listFilter(Object collection, String filter, QueryParameters queryParameters)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.listFilter.

Execute a filter
protected Object
private void
private 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 ScrollableResultsImplementor
scroll(Criteria criteria, ScrollMode scrollMode)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.scroll.

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

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.scroll.

Execute a scroll() query
public ScrollableResultsImplementor
public void
setAutoClear(boolean enabled)

Implements org.hibernate.engine.spi.SharedSessionContractImplementor.setAutoClear.

Enable/disable automatic cache clearing from after transaction completion (for EJB3)
public void
public void
setDefaultReadOnly(boolean readOnly)

public void
public void
public boolean
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.
Inherited from org.hibernate.internal.AbstractSharedSessionContract:
accessTransactionaddSharedSessionTransactionObserverapplyQuerySettingsAndHintsbeginTransactionbuildQueryFromNamecheckOpencheckOpenOrWaitingForAutoClosecheckTransactionNeededForUpdateOperationcheckTransactionSynchStatuscleanupOnCloseclosecreateNamedQuerycreateNamedQuerycreateNativeQuerycreateNativeQuerycreateNativeQuerycreateNativeQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateQuerycreateSQLQuerycreateStoredProcedureCallcreateStoredProcedureCallcreateStoredProcedureCallcriteriaCompilerdelayedAfterCompletiondoReturningWorkdoWorkerrorIfClosedexecutegenerateEntityKeygetCacheTransactionSynchronizationgetConfiguredJdbcBatchSizegetCurrentTransactiongetEntityNameResolvergetEventListenerManagergetExceptionConvertergetFactorygetFlushModegetHibernateFlushModegetInterceptorgetJdbcBatchSizegetJdbcConnectionAccessgetJdbcCoordinatorgetJdbcServicesgetJdbcSessionContextgetJdbcTimeZonegetLobCreatorgetNamedNativeQuerygetNamedProcedureCallgetNamedQuerygetNamedSQLQuerygetNativeQueryImplementorgetNativeQueryPlangetQueryPlangetSessionIdentifiergetTenantIdentifiergetTransactiongetTransactionCoordinatorgetTransactionStartTimestampinitQueryFromNamedDefinitionisClosedisConnectedisOpenisOpenOrWaitingForAutoCloselistmarkForRollbackOnlyprepareForAutoClosepulseTransactionCoordinatorremapSqlTypeDescriptorremoveSharedSessionTransactionObserverresultClassCheckingresultClassCheckingscrollsetClosedsetJdbcBatchSizeshouldCloseJdbcCoordinatorOnClosestartTransactionBoundaryuseStreamForLobBinding