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.
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Redeclares org. |
| public Connection | Returns: The connection associated with this stateless session
Deprecated
just missed when deprecating same method from
Returns the current JDBC connection associated with this
instance.
Session
|
| public NativeQuery | createSQLQuery(String
The SQL query queryString)Redeclares as abstract: org.
Deprecated
as a consequence of
Create a NativeQuery being deprecated.
NativeQuery instance for the given SQL query string.
|
| public void | |
| public void | |
| public Object | Returns: a detached entity instanceThe name of the entity to retrieve entityName, Serializable The id of the entity to retrieve id)Retrieve a row. |
| public Object | Returns: a detached entity instanceThe class of the entity to retrieve entityClass, Serializable The id of the entity to retrieve id)Retrieve a row. |
| public Object | Returns: a detached entity instanceThe 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)Retrieve a row, obtaining the specified lock mode. |
| public Object | Returns: a detached entity instanceThe 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)Retrieve a row, obtaining the specified lock mode. |
| public Serializable | |
| public Serializable | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void |
| close | back to summary |
|---|---|
| public void close() Redeclares org. Close the stateless session and release the JDBC connection. | |
| connection | back to summary |
|---|---|
| public Connection connection()
Deprecated just missed when deprecating same method from Returns the current JDBC connection associated with this
instance.
| |
| createSQLQuery | back to summary |
|---|---|
| public NativeQuery Redeclares as abstract: org. Doc from org. Deprecated as a consequence of Create a
| |
| delete | back to summary |
|---|---|
| public void delete(Object entity) Delete a row.
| |
| delete | back to summary |
|---|---|
| public void delete(String entityName, Object entity) Delete a row. | |
| get | back to summary |
|---|---|
| public Object get(String entityName, Serializable id) Retrieve a row.
| |
| get | back to summary |
|---|---|
| public Object get(Class<T> entityClass, Serializable id) Retrieve a row.
| |
| get | back to summary |
|---|---|
| public Object get(String entityName, Serializable id, LockMode lockMode) Retrieve a row, obtaining the specified lock mode.
| |
| get | back to summary |
|---|---|
| public Object get(Class<T> entityClass, Serializable id, LockMode lockMode) Retrieve a row, obtaining the specified lock mode.
| |
| insert | back to summary |
|---|---|
| public Serializable insert(Object entity) Insert a row.
| |
| insert | back to summary |
|---|---|
| public Serializable insert(String entityName, Object entity) Insert a row.
| |
| refresh | back to summary |
|---|---|
| public void refresh(Object entity) Refresh the entity instance state from the database.
| |
| refresh | back to summary |
|---|---|
| public void refresh(String entityName, Object entity) Refresh the entity instance state from the database. | |
| refresh | back to summary |
|---|---|
| public void refresh(Object entity, LockMode lockMode) Refresh the entity instance state from the database. | |
| refresh | back to summary |
|---|---|
| public void refresh(String entityName, Object entity, LockMode lockMode) Refresh the entity instance state from the database. | |
| update | back to summary |
|---|---|
| public void update(Object entity) Update a row.
| |
| update | back to summary |
|---|---|
| public void update(String entityName, Object entity) Update a row. | |