程序包 org.hibernate
接口 StatelessSession
-
- 所有已知实现类:
StatelessSessionImpl
public interface StatelessSession extends SharedSessionContract, AutoCloseable, Closeable
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.- 作者:
- Gavin King
-
-
方法概要
所有方法 实例方法 抽象方法 已过时的方法 修饰符和类型 方法 说明 voidclose()Close the stateless session and release the JDBC connection.Connectionconnection()已过时。just missed when deprecating same method fromSessionNativeQuerycreateSQLQuery(String queryString)Create aNativeQueryinstance for the given SQL query string.voiddelete(Object entity)Delete a row.voiddelete(String entityName, Object entity)Delete a row.Objectget(Class entityClass, Serializable id)Retrieve a row.Objectget(Class entityClass, Serializable id, LockMode lockMode)Retrieve a row, obtaining the specified lock mode.Objectget(String entityName, Serializable id)Retrieve a row.Objectget(String entityName, Serializable id, LockMode lockMode)Retrieve a row, obtaining the specified lock mode.Serializableinsert(Object entity)Insert a row.Serializableinsert(String entityName, Object entity)Insert a row.voidrefresh(Object entity)Refresh the entity instance state from the database.voidrefresh(Object entity, LockMode lockMode)Refresh the entity instance state from the database.voidrefresh(String entityName, Object entity)Refresh the entity instance state from the database.voidrefresh(String entityName, Object entity, LockMode lockMode)Refresh the entity instance state from the database.voidupdate(Object entity)Update a row.voidupdate(String entityName, Object entity)Update a row.-
从接口继承的方法 org.hibernate.query.QueryProducer
createNamedQuery, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, getNamedNativeQuery, getNamedSQLQuery
-
从接口继承的方法 org.hibernate.SharedSessionContract
beginTransaction, createCriteria, createCriteria, createCriteria, createCriteria, createQuery, createStoredProcedureCall, createStoredProcedureCall, createStoredProcedureCall, doReturningWork, doWork, getJdbcBatchSize, getNamedProcedureCall, getNamedQuery, getTenantIdentifier, getTransaction, isConnected, isOpen, setJdbcBatchSize
-
-
-
-
方法详细资料
-
close
void close()
Close the stateless session and release the JDBC connection.- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 指定者:
close在接口中SharedSessionContract
-
insert
Serializable insert(Object entity)
Insert a row.- 参数:
entity- a new transient instance- 返回:
- The identifier of the inserted entity
-
insert
Serializable insert(String entityName, Object entity)
Insert a row.- 参数:
entityName- The entityName for the entity to be insertedentity- a new transient instance- 返回:
- the identifier of the instance
-
update
void update(Object entity)
Update a row.- 参数:
entity- a detached entity instance
-
update
void update(String entityName, Object entity)
Update a row.- 参数:
entityName- The entityName for the entity to be updatedentity- a detached entity instance
-
delete
void delete(Object entity)
Delete a row.- 参数:
entity- a detached entity instance
-
delete
void delete(String entityName, Object entity)
Delete a row.- 参数:
entityName- The entityName for the entity to be deletedentity- a detached entity instance
-
get
Object get(String entityName, Serializable id)
Retrieve a row.- 参数:
entityName- The name of the entity to retrieveid- The id of the entity to retrieve- 返回:
- a detached entity instance
-
get
Object get(Class entityClass, Serializable id)
Retrieve a row.- 参数:
entityClass- The class of the entity to retrieveid- The id of the entity to retrieve- 返回:
- a detached entity instance
-
get
Object get(String entityName, Serializable id, LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.- 参数:
entityName- The name of the entity to retrieveid- The id of the entity to retrievelockMode- The lock mode to apply to the entity- 返回:
- a detached entity instance
-
get
Object get(Class entityClass, Serializable id, LockMode lockMode)
Retrieve a row, obtaining the specified lock mode.- 参数:
entityClass- The class of the entity to retrieveid- The id of the entity to retrievelockMode- The lock mode to apply to the entity- 返回:
- a detached entity instance
-
refresh
void refresh(Object entity)
Refresh the entity instance state from the database.- 参数:
entity- The entity to be refreshed.
-
refresh
void refresh(String entityName, Object entity)
Refresh the entity instance state from the database.- 参数:
entityName- The entityName for the entity to be refreshed.entity- The entity to be refreshed.
-
refresh
void refresh(Object entity, LockMode lockMode)
Refresh the entity instance state from the database.- 参数:
entity- The entity to be refreshed.lockMode- The LockMode to be applied.
-
refresh
void refresh(String entityName, Object entity, LockMode lockMode)
Refresh the entity instance state from the database.- 参数:
entityName- The entityName for the entity to be refreshed.entity- The entity to be refreshed.lockMode- The LockMode to be applied.
-
connection
@Deprecated Connection connection()
已过时。just missed when deprecating same method fromSessionReturns 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.- 返回:
- The connection associated with this stateless session
-
createSQLQuery
NativeQuery createSQLQuery(String queryString)
从接口复制的说明:QueryProducerCreate aNativeQueryinstance for the given SQL query string.- 指定者:
createSQLQuery在接口中QueryProducer- 参数:
queryString- The SQL query- 返回:
- The query instance for manipulation and execution
-
-