Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.hibernate.impl.AbstractSessionImpl
org.hibernate.impl.StatelessSessionImpl
public class StatelessSessionImpl
extends AbstractSessionImpl
implements JDBCContext.Context, StatelessSession
Field Summary |
Fields inherited from class org.hibernate.impl.AbstractSessionImpl | |
factory |
Method Summary | |
void |
|
void | |
void |
|
void |
|
protected boolean |
|
void | |
Transaction |
|
String |
|
void |
|
Connection |
|
Criteria |
|
Criteria |
|
Criteria |
|
Criteria |
|
void |
|
void |
|
int |
|
int |
|
void |
|
Object |
|
Object | |
Object |
|
Object | |
Batcher | |
CacheMode | |
ConnectionReleaseMode | |
Serializable |
|
int | |
Map | |
EntityMode | |
EntityPersister |
|
Object | |
String | |
Type |
|
Object |
|
FlushMode | |
Interceptor | |
JDBCContext | |
EventListeners | |
PersistenceContext | |
long | |
Transaction |
|
String |
|
Object |
|
void |
|
Serializable |
|
Serializable |
|
Object |
|
Object |
|
boolean | |
boolean | |
boolean | |
boolean | |
boolean | |
boolean |
|
boolean | |
Iterator |
|
Iterator |
|
List |
|
List |
|
List |
|
List |
|
void | |
void | |
void |
|
void | |
void |
|
void | |
ScrollableResults |
|
ScrollableResults |
|
ScrollableResults |
|
void |
|
void | |
void |
|
void | |
boolean | |
void |
|
void |
|
Methods inherited from class org.hibernate.impl.AbstractSessionImpl | |
createQuery , createSQLQuery , errorIfClosed , getFactory , getHQLQueryPlan , getNamedQuery , getNamedSQLQuery , getNativeSQLQueryPlan , isClosed , list , scroll , setClosed |
public void afterOperation(boolean success)
public void afterScrollOperation()
- Specified by:
- afterScrollOperation in interface SessionImplementor
public void afterTransactionBegin(Transaction tx)
We cannot rely upon this method being called! It is only called if we are using Hibernate Transaction API.
- Specified by:
- afterTransactionBegin in interface JDBCContext.Context
public void afterTransactionCompletion(boolean successful, Transaction tx)
- Specified by:
- afterTransactionCompletion in interface JDBCContext.Context
- afterTransactionCompletion in interface SessionImplementor
public void beforeTransactionCompletion(Transaction tx)
- Specified by:
- beforeTransactionCompletion in interface JDBCContext.Context
- beforeTransactionCompletion in interface SessionImplementor
public Transaction beginTransaction() throws HibernateException
Begin a Hibernate transaction.
- Specified by:
- beginTransaction in interface StatelessSession
public String bestGuessEntityName(Object object)
- Specified by:
- bestGuessEntityName in interface SessionImplementor
public void close()
Close the stateless session and release the JDBC connection.
- Specified by:
- close in interface StatelessSession
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.
- Specified by:
- connection in interface StatelessSession
- connection in interface SessionImplementor
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.
- Specified by:
- createCriteria in interface StatelessSession
- 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.
- Specified by:
- createCriteria in interface StatelessSession
- Parameters:
persistentClass
- a class, which is persistent, or has persistent subclasses
- Returns:
- Criteria
public Criteria createCriteria(String entityName)
Create a new Criteria instance, for the given entity name. Entities returned by the query are detached.
- Specified by:
- createCriteria in interface StatelessSession
- Parameters:
entityName
-
- 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.
- Specified by:
- createCriteria in interface StatelessSession
- Parameters:
entityName
-
- Returns:
- Criteria
public void delete(Object entity)
Delete a row.
- Specified by:
- delete in interface StatelessSession
- Parameters:
entity
- a detached entity instance
public void delete(String entityName, Object entity)
Delete a row.
- Specified by:
- delete in interface StatelessSession
- Parameters:
entityName
- The entityName for the entity to be deletedentity
- a detached entity instance
public int executeNativeUpdate(NativeSQLQuerySpecification nativeSQLQuerySpecification, QueryParameters queryParameters) throws HibernateException
- Specified by:
- executeNativeUpdate in interface SessionImplementor
public int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException
- Specified by:
- executeUpdate in interface SessionImplementor
public Object get(Class entityClass, Serializable id)
Retrieve a row.
- Specified by:
- get in interface StatelessSession
- Returns:
- a detached entity instance
public Object get(Class entityClass, Serializable id, LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.
- Specified by:
- get in interface StatelessSession
- Returns:
- a detached entity instance
public Object get(String entityName, Serializable id)
Retrieve a row.
- Specified by:
- get in interface StatelessSession
- Returns:
- a detached entity instance
public Object get(String entityName, Serializable id, LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.
- Specified by:
- get in interface StatelessSession
- Returns:
- a detached entity instance
public CacheMode getCacheMode()
- Specified by:
- getCacheMode in interface SessionImplementor
public ConnectionReleaseMode getConnectionReleaseMode()
- Specified by:
- getConnectionReleaseMode in interface JDBCContext.Context
public Serializable getContextEntityIdentifier(Object object)
- Specified by:
- getContextEntityIdentifier in interface SessionImplementor
public int getDontFlushFromFind()
- Specified by:
- getDontFlushFromFind in interface SessionImplementor
public Map getEnabledFilters()
- Specified by:
- getEnabledFilters in interface SessionImplementor
public EntityMode getEntityMode()
- Specified by:
- getEntityMode in interface SessionImplementor
public EntityPersister getEntityPersister(String entityName, Object object) throws HibernateException
- Specified by:
- getEntityPersister in interface SessionImplementor
public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
- Specified by:
- getEntityUsingInterceptor in interface SessionImplementor
public String getFetchProfile()
- Specified by:
- getFetchProfile in interface SessionImplementor
public Type getFilterParameterType(String filterParameterName)
- Specified by:
- getFilterParameterType in interface SessionImplementor
public Object getFilterParameterValue(String filterParameterName)
- Specified by:
- getFilterParameterValue in interface SessionImplementor
public FlushMode getFlushMode()
- Specified by:
- getFlushMode in interface SessionImplementor
public Interceptor getInterceptor()
- Specified by:
- getInterceptor in interface SessionImplementor
public JDBCContext getJDBCContext()
- Specified by:
- getJDBCContext in interface SessionImplementor
public EventListeners getListeners()
- Specified by:
- getListeners in interface SessionImplementor
public PersistenceContext getPersistenceContext()
- Specified by:
- getPersistenceContext in interface SessionImplementor
public Transaction getTransaction() throws HibernateException
Get the current Hibernate transaction.
- Specified by:
- getTransaction in interface StatelessSession
public String guessEntityName(Object entity) throws HibernateException
- Specified by:
- guessEntityName in interface SessionImplementor
public Object immediateLoad(String entityName, Serializable id) throws HibernateException
- Specified by:
- immediateLoad in interface SessionImplementor
public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException
- Specified by:
- initializeCollection in interface SessionImplementor
public Serializable insert(Object entity)
Insert a row.
- Specified by:
- insert in interface StatelessSession
- Parameters:
entity
- a new transient instance
public Serializable insert(String entityName, Object entity)
Insert a row.
- Specified by:
- insert in interface StatelessSession
- Parameters:
entityName
- The entityName for the entity to be insertedentity
- a new transient instance
- Returns:
- the identifier of the instance
public Object instantiate(String entityName, Serializable id) throws HibernateException
- Specified by:
- instantiate in interface SessionImplementor
public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException
- Specified by:
- internalLoad in interface SessionImplementor
public boolean isAutoCloseSessionEnabled()
- Specified by:
- isAutoCloseSessionEnabled in interface JDBCContext.Context
public boolean isEventSource()
- Specified by:
- isEventSource in interface SessionImplementor
public boolean isFlushBeforeCompletionEnabled()
- Specified by:
- isFlushBeforeCompletionEnabled in interface TransactionFactory.Context
public boolean isFlushModeNever()
- Specified by:
- isFlushModeNever in interface TransactionFactory.Context
public boolean isTransactionInProgress()
- Specified by:
- isTransactionInProgress in interface SessionImplementor
public Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException
- Specified by:
- iterate in interface SessionImplementor
public Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
- Specified by:
- iterateFilter in interface SessionImplementor
public List list(String query, QueryParameters queryParameters) throws HibernateException
- Specified by:
- list in interface SessionImplementor
public List list(CriteriaImpl criteria) throws HibernateException
- Specified by:
- list in interface SessionImplementor
public List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
- Specified by:
- listCustomQuery in interface SessionImplementor
public List listFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
- Specified by:
- listFilter in interface SessionImplementor
public void managedClose()
- Specified by:
- managedClose in interface TransactionFactory.Context
public void managedFlush()
- Specified by:
- managedFlush in interface TransactionFactory.Context
public void refresh(Object entity)
Refresh the entity instance state from the database.
- Specified by:
- refresh in interface StatelessSession
- Parameters:
entity
- The entity to be refreshed.
public void refresh(Object entity, LockMode lockMode)
Refresh the entity instance state from the database.
- Specified by:
- refresh in interface StatelessSession
- Parameters:
entity
- The entity to be refreshed.lockMode
- The LockMode to be applied.
public void refresh(String entityName, Object entity)
Refresh the entity instance state from the database.
- Specified by:
- refresh in interface StatelessSession
- 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.
- Specified by:
- refresh in interface StatelessSession
- Parameters:
entityName
- The entityName for the entity to be refreshed.entity
- The entity to be refreshed.lockMode
- The LockMode to be applied.
public ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException
- Specified by:
- scroll in interface SessionImplementor
public ScrollableResults scroll(CriteriaImpl criteria, ScrollMode scrollMode)
- Specified by:
- scroll in interface SessionImplementor
public ScrollableResults scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
- Specified by:
- scrollCustomQuery in interface SessionImplementor
public void setAutoClear(boolean enabled)
- Specified by:
- setAutoClear in interface SessionImplementor
public void setCacheMode(CacheMode cm)
- Specified by:
- setCacheMode in interface SessionImplementor
public void setFetchProfile(String name)
- Specified by:
- setFetchProfile in interface SessionImplementor
public void setFlushMode(FlushMode fm)
- Specified by:
- setFlushMode in interface SessionImplementor
public boolean shouldAutoClose()
- Specified by:
- shouldAutoClose in interface TransactionFactory.Context
public void update(Object entity)
Update a row.
- Specified by:
- update in interface StatelessSession
- Parameters:
entity
- a detached entity instance
public void update(String entityName, Object entity)
Update a row.
- Specified by:
- update in interface StatelessSession
- Parameters:
entityName
- The entityName for the entity to be updatedentity
- a detached entity instance