public interface SharedSessionContract extends QueryProducer, Serializable
Session
and StatelessSession
.
NOTE : Poorly named. "shared" simply indicates that its a unified contract between Session
and
StatelessSession
.Modifier and Type | Method and Description |
---|---|
Transaction |
beginTransaction()
Begin a unit of work and return the associated
Transaction object. |
void |
close()
End the session by releasing the JDBC connection and cleaning up.
|
Criteria |
createCriteria(Class persistentClass)
Deprecated.
(since 5.2) for Session, use the JPA Criteria
|
Criteria |
createCriteria(Class persistentClass,
String alias)
Deprecated.
(since 5.2) for Session, use the JPA Criteria
|
Criteria |
createCriteria(String entityName)
Deprecated.
(since 5.2) for Session, use the JPA Criteria
|
Criteria |
createCriteria(String entityName,
String alias)
Deprecated.
(since 5.2) for Session, use the JPA Criteria
|
ProcedureCall |
createStoredProcedureCall(String procedureName)
Creates a call to a stored procedure.
|
ProcedureCall |
createStoredProcedureCall(String procedureName,
Class... resultClasses)
Creates a call to a stored procedure with specific result set entity mappings.
|
ProcedureCall |
createStoredProcedureCall(String procedureName,
String... resultSetMappings)
Creates a call to a stored procedure with specific result set entity mappings.
|
Integer |
getJdbcBatchSize()
Get the Session-level JDBC batch size for the current Session.
|
ProcedureCall |
getNamedProcedureCall(String name)
Gets a ProcedureCall based on a named template
|
String |
getTenantIdentifier()
Obtain the tenant identifier associated with this session.
|
Transaction |
getTransaction()
Get the
Transaction instance associated with this session. |
boolean |
isConnected()
Check if the session is currently connected.
|
boolean |
isOpen()
Check if the session is still open.
|
void |
setJdbcBatchSize(Integer jdbcBatchSize)
Set the Session-level JDBC batch size.
|
createNamedQuery, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createSQLQuery, getNamedNativeQuery, getNamedQuery, getNamedSQLQuery
String getTenantIdentifier()
null
void close() throws HibernateException
HibernateException
- Indicates problems cleaning up.boolean isOpen()
boolean isConnected()
Transaction beginTransaction()
Transaction
object. If a new underlying transaction is
required, begin the transaction. Otherwise continue the new work in the context of the existing underlying
transaction.getTransaction()
Transaction getTransaction()
Transaction
instance associated with this session. The concrete type of the returned
Transaction
object is determined by the hibernate.transaction_factory
property.ProcedureCall getNamedProcedureCall(String name)
name
- The name given to the templateNamedStoredProcedureQuery
ProcedureCall createStoredProcedureCall(String procedureName)
procedureName
- The name of the procedure.ProcedureCall createStoredProcedureCall(String procedureName, Class... resultClasses)
procedureName
- The name of the procedure.resultClasses
- The entity(s) to map the result on to.ProcedureCall createStoredProcedureCall(String procedureName, String... resultSetMappings)
procedureName
- The name of the procedure.resultSetMappings
- The explicit result set mapping(s) to use for mapping the results@Deprecated Criteria createCriteria(Class persistentClass)
Criteria
instance for the given class (entity or subclasses/implementors).persistentClass
- The class, which is an entity, or has entity subclasses/implementors@Deprecated Criteria createCriteria(Class persistentClass, String alias)
Criteria
instance for the given class (entity or subclasses/implementors), using a specific
alias.persistentClass
- The class, which is an entity, or has entity subclasses/implementorsalias
- The alias to use@Deprecated Criteria createCriteria(String entityName)
Criteria
instance for the given entity name.entityName
- The entity name@Deprecated Criteria createCriteria(String entityName, String alias)
Criteria
instance for the given entity name, using a specific alias.entityName
- The entity namealias
- The alias to useInteger getJdbcBatchSize()
hibernate.default_batch_fetch_size
configuration property for the scope of the current Session
.SessionFactoryOptions.getJdbcBatchSize()
,
SessionFactoryBuilder.applyJdbcBatchSize(int)
void setJdbcBatchSize(Integer jdbcBatchSize)
hibernate.default_batch_fetch_size
configuration property for the scope of the current Session
.jdbcBatchSize
- Session-level JDBC batch sizeSessionFactoryOptions.getJdbcBatchSize()
,
SessionFactoryBuilder.applyJdbcBatchSize(int)
Copyright © 2019 JBoss by Red Hat. All rights reserved.