|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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. |
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(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. |
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. |
Query |
createQuery(String queryString)
Create a new instance of Query for the given HQL query string. |
SQLQuery |
createSQLQuery(String queryString)
Create a new instance of SQLQuery for the given SQL query string. |
void |
delete(Object entity)
Delete a row. |
void |
delete(String entityName,
Object entity)
Delete a row. |
Object |
get(Class entityClass,
Serializable id)
Retrieve a row. |
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(String entityName,
Serializable id,
LockMode lockMode)
Retrieve a row, obtaining the specified lock mode. |
Query |
getNamedQuery(String queryName)
Obtain an instance of Query for a named query string defined in the mapping file. |
Transaction |
getTransaction()
Get the current Hibernate transaction. |
Serializable |
insert(Object entity)
Insert a row. |
Serializable |
insert(String entityName,
Object entity)
Insert a row. |
void |
refresh(Object entity)
Refresh the entity instance state from the database. |
void |
refresh(Object entity,
LockMode lockMode)
Refresh the entity instance state from the database. |
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 |
update(Object entity)
Update a row. |
void |
update(String entityName,
Object entity)
Update a row. |
Method Detail |
public void close()
public Serializable insert(Object entity)
entity
- a new transient instancepublic Serializable insert(String entityName, Object entity)
entityName
- The entityName for the entity to be insertedentity
- a new transient instance
public void update(Object entity)
entity
- a detached entity instancepublic void update(String entityName, Object entity)
entityName
- The entityName for the entity to be updatedentity
- a detached entity instancepublic void delete(Object entity)
entity
- a detached entity instancepublic void delete(String entityName, Object entity)
entityName
- The entityName for the entity to be deletedentity
- a detached entity instancepublic Object get(String entityName, Serializable id)
public Object get(Class entityClass, Serializable id)
public Object get(String entityName, Serializable id, LockMode lockMode)
public Object get(Class entityClass, Serializable id, LockMode lockMode)
public void refresh(Object entity)
entity
- The entity to be refreshed.public void refresh(String entityName, Object entity)
entityName
- The entityName for the entity to be refreshed.entity
- The entity to be refreshed.public void refresh(Object entity, LockMode lockMode)
entity
- The entity to be refreshed.lockMode
- The LockMode to be applied.public void refresh(String entityName, Object entity, LockMode lockMode)
entityName
- The entityName for the entity to be refreshed.entity
- The entity to be refreshed.lockMode
- The LockMode to be applied.public Query createQuery(String queryString)
public Query getNamedQuery(String queryName)
public Criteria createCriteria(Class persistentClass)
persistentClass
- a class, which is persistent, or has persistent subclasses
public Criteria createCriteria(Class persistentClass, String alias)
persistentClass
- a class, which is persistent, or has persistent subclasses
public Criteria createCriteria(String entityName)
entityName
-
public Criteria createCriteria(String entityName, String alias)
entityName
-
public SQLQuery createSQLQuery(String queryString) throws HibernateException
queryString
- a SQL query
HibernateException
public Transaction beginTransaction()
public Transaction getTransaction()
public Connection connection()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |