public interface SharedSessionContract extends QueryProducer, Serializable
Contract methods shared between Session
and StatelessSession
.
<p/>
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()
Obtain the tenant identifier associated with this session.
null
void close() throws HibernateException
End the session by releasing the JDBC connection and cleaning up.
HibernateException
- Indicates problems cleaning up.boolean isOpen()
Check if the session is still open.
boolean isConnected()
Check if the session is currently connected.
Transaction beginTransaction()
Begin a unit of work and return the associated 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()
Get the 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)
Gets a ProcedureCall based on a named template
name
- The name given to the templateNamedStoredProcedureQuery
ProcedureCall createStoredProcedureCall(String procedureName)
Creates a call to a stored procedure.
procedureName
- The name of the procedure.ProcedureCall createStoredProcedureCall(String procedureName, Class... resultClasses)
Creates a call to a stored procedure with specific result set entity mappings. Each class named is considered a "root return".
procedureName
- The name of the procedure.resultClasses
- The entity(s) to map the result on to.ProcedureCall createStoredProcedureCall(String procedureName, String... resultSetMappings)
Creates a call to a stored procedure with specific result set entity mappings.
procedureName
- The name of the procedure.resultSetMappings
- The explicit result set mapping(s) to use for mapping the results@Deprecated Criteria createCriteria(Class persistentClass)
Create 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)
Create 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)
Create Criteria
instance for the given entity name.
entityName
- The entity name@Deprecated Criteria createCriteria(String entityName, String alias)
Create Criteria
instance for the given entity name, using a specific alias.
entityName
- The entity namealias
- The alias to useInteger getJdbcBatchSize()
Get the Session-level JDBC batch size for the current Session.
Overrides the SessionFactory JDBC batch size defined by the hibernate.default_batch_fetch_size
configuration property for the scope of the current Session
.
SessionFactoryOptions.getJdbcBatchSize()
,
SessionFactoryBuilder.applyJdbcBatchSize(int)
void setJdbcBatchSize(Integer jdbcBatchSize)
Set the Session-level JDBC batch size.
Overrides the SessionFactory JDBC batch size defined by the 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 © 2001-2018 Red Hat, Inc. All Rights Reserved.