Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hibernate
Interface StatelessSession  view StatelessSession download StatelessSession.java

All Superinterfaces:
java.io.Serializable

public interface StatelessSession
extends java.io.Serializable

A command-oriented API for performing bulk operations against a database.

A stateless session does not implement a first-level cache nor interact with any second-level cache, nor does it implement transactional write-behind or automatic dirty checking, nor do operations cascade to associated instances. Collections are ignored by a stateless session. Operations performed via a stateless session bypass Hibernate's event model and interceptors. Stateless sessions are vulnerable to data aliasing effects, due to the lack of a first-level cache.

For certain kinds of transactions, a stateless session may perform slightly faster than a stateful session.


Method Summary
 Transaction beginTransaction()
          Begin a Hibernate transaction.
 void close()
          Close the stateless session and release the JDBC connection.
 java.sql.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.
 Criteria createCriteria(java.lang.Class persistentClass)
          Create a new Criteria instance, for the given entity class, or a superclass of an entity class.
 Criteria createCriteria(java.lang.Class persistentClass, java.lang.String alias)
          Create a new Criteria instance, for the given entity class, or a superclass of an entity class, with the given alias.
 Criteria createCriteria(java.lang.String entityName)
          Create a new Criteria instance, for the given entity name.
 Criteria createCriteria(java.lang.String entityName, java.lang.String alias)
          Create a new Criteria instance, for the given entity name, with the given alias.
 Query createQuery(java.lang.String queryString)
          Create a new instance of Query for the given HQL query string.
 SQLQuery createSQLQuery(java.lang.String queryString)
          Create a new instance of SQLQuery for the given SQL query string.
 void delete(java.lang.Object entity)
          Delete a row.
 void delete(java.lang.String entityName, java.lang.Object entity)
          Delete a row.
 java.lang.Object get(java.lang.Class entityClass, java.io.Serializable id)
          Retrieve a row.
 java.lang.Object get(java.lang.Class entityClass, java.io.Serializable id, LockMode lockMode)
          Retrieve a row, obtaining the specified lock mode.
 java.lang.Object get(java.lang.String entityName, java.io.Serializable id)
          Retrieve a row.
 java.lang.Object get(java.lang.String entityName, java.io.Serializable id, LockMode lockMode)
          Retrieve a row, obtaining the specified lock mode.
 Query getNamedQuery(java.lang.String queryName)
          Obtain an instance of Query for a named query string defined in the mapping file.
 Transaction getTransaction()
          Get the current Hibernate transaction.
 java.io.Serializable insert(java.lang.Object entity)
          Insert a row.
 java.io.Serializable insert(java.lang.String entityName, java.lang.Object entity)
          Insert a row.
 void refresh(java.lang.Object entity)
          Refresh the entity instance state from the database.
 void refresh(java.lang.Object entity, LockMode lockMode)
          Refresh the entity instance state from the database.
 void refresh(java.lang.String entityName, java.lang.Object entity)
          Refresh the entity instance state from the database.
 void refresh(java.lang.String entityName, java.lang.Object entity, LockMode lockMode)
          Refresh the entity instance state from the database.
 void update(java.lang.Object entity)
          Update a row.
 void update(java.lang.String entityName, java.lang.Object entity)
          Update a row.
 

Method Detail

close

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


insert

public java.io.Serializable insert(java.lang.Object entity)
Insert a row.


insert

public java.io.Serializable insert(java.lang.String entityName,
                                   java.lang.Object entity)
Insert a row.


update

public void update(java.lang.Object entity)
Update a row.


update

public void update(java.lang.String entityName,
                   java.lang.Object entity)
Update a row.


delete

public void delete(java.lang.Object entity)
Delete a row.


delete

public void delete(java.lang.String entityName,
                   java.lang.Object entity)
Delete a row.


get

public java.lang.Object get(java.lang.String entityName,
                            java.io.Serializable id)
Retrieve a row.


get

public java.lang.Object get(java.lang.Class entityClass,
                            java.io.Serializable id)
Retrieve a row.


get

public java.lang.Object get(java.lang.String entityName,
                            java.io.Serializable id,
                            LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.


get

public java.lang.Object get(java.lang.Class entityClass,
                            java.io.Serializable id,
                            LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.


refresh

public void refresh(java.lang.Object entity)
Refresh the entity instance state from the database.


refresh

public void refresh(java.lang.String entityName,
                    java.lang.Object entity)
Refresh the entity instance state from the database.


refresh

public void refresh(java.lang.Object entity,
                    LockMode lockMode)
Refresh the entity instance state from the database.


refresh

public void refresh(java.lang.String entityName,
                    java.lang.Object entity,
                    LockMode lockMode)
Refresh the entity instance state from the database.


createQuery

public Query createQuery(java.lang.String queryString)
Create a new instance of Query for the given HQL query string. Entities returned by the query are detached.


getNamedQuery

public Query getNamedQuery(java.lang.String queryName)
Obtain an instance of Query for a named query string defined in the mapping file. Entities returned by the query are detached.


createCriteria

public Criteria createCriteria(java.lang.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.


createCriteria

public Criteria createCriteria(java.lang.Class persistentClass,
                               java.lang.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.


createCriteria

public Criteria createCriteria(java.lang.String entityName)
Create a new Criteria instance, for the given entity name. Entities returned by the query are detached.


createCriteria

public Criteria createCriteria(java.lang.String entityName,
                               java.lang.String alias)
Create a new Criteria instance, for the given entity name, with the given alias. Entities returned by the query are detached.


createSQLQuery

public SQLQuery createSQLQuery(java.lang.String queryString)
                        throws HibernateException
Create a new instance of SQLQuery for the given SQL query string. Entities returned by the query are detached.


beginTransaction

public Transaction beginTransaction()
Begin a Hibernate transaction.


getTransaction

public Transaction getTransaction()
Get the current Hibernate transaction.


connection

public java.sql.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.