public class StatelessSessionWrapper extends AbstractQueryCache implements StatelessSession
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
private StatelessSession |
session |
Constructor and Description |
---|
StatelessSessionWrapper(StatelessSession session)
Creates a new session wrapper
|
Modifier and Type | Method and Description |
---|---|
Transaction |
beginTransaction() |
void |
cancelQuery()
Cancels the currently executing query in the same manner as
Session.cancelQuery() . |
void |
close() |
Connection |
connection()
Deprecated.
|
Criteria |
createCriteria(Class persistentClass) |
Criteria |
createCriteria(Class persistentClass,
String alias) |
Criteria |
createCriteria(String entityName) |
Criteria |
createCriteria(String entityName,
String alias) |
Query |
createQuery(String queryString)
If the same query has been executed before, return the cached
instance, otherwise create a new query from the parent session
and cache it.
|
SQLQuery |
createSQLQuery(String queryString)
If the same query has been executed before, return the cached
instance, otherwise create a new query from the parent session
and cache it.
|
ProcedureCall |
createStoredProcedureCall(String name) |
ProcedureCall |
createStoredProcedureCall(String paramString,
Class... paramArrayOfClass) |
ProcedureCall |
createStoredProcedureCall(String paramString,
String... paramArrayOfString) |
void |
delete(Object entity) |
void |
delete(String entityName,
Object entity) |
Object |
get(Class entityClass,
Serializable id) |
Object |
get(Class entityClass,
Serializable id,
LockMode lockMode) |
Object |
get(String entityName,
Serializable id) |
Object |
get(String entityName,
Serializable id,
LockMode lockMode) |
ProcedureCall |
getNamedProcedureCall(String name) |
Query |
getNamedQuery(String queryName)
If the same query has been executed before, return the cached
instance, otherwise create a new query from the parent session
and cache it.
|
StatelessSession |
getParentSession()
Get the underlying parent session from Hibernate.
|
String |
getTenantIdentifier() |
Transaction |
getTransaction() |
Serializable |
insert(Object entity) |
Serializable |
insert(String entityName,
Object entity) |
void |
refresh(Object entity) |
void |
refresh(Object entity,
LockMode lockMode) |
void |
refresh(String entityName,
Object entity) |
void |
refresh(String entityName,
Object entity,
LockMode lockMode) |
void |
update(Object entity) |
void |
update(String entityName,
Object entity) |
cacheQuery, getCachedQuery
private static final long serialVersionUID
private final StatelessSession session
public StatelessSessionWrapper(StatelessSession session)
session
- The real Hibernate sessionpublic StatelessSession getParentSession()
public void cancelQuery() throws HibernateException
Session.cancelQuery()
.
Since this method is not part of the StatelessSession interface this only works if
the underlying parent session is the Hibernate implementation.HibernateException
public Transaction beginTransaction()
beginTransaction
in interface SharedSessionContract
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in interface StatelessSession
@Deprecated public Connection connection()
connection
in interface StatelessSession
public Criteria createCriteria(Class persistentClass, String alias)
createCriteria
in interface SharedSessionContract
public Criteria createCriteria(Class persistentClass)
createCriteria
in interface SharedSessionContract
public Criteria createCriteria(String entityName, String alias)
createCriteria
in interface SharedSessionContract
public Criteria createCriteria(String entityName)
createCriteria
in interface SharedSessionContract
public Query createQuery(String queryString) throws HibernateException
createQuery
in interface SharedSessionContract
HibernateException
public SQLQuery createSQLQuery(String queryString) throws HibernateException
createSQLQuery
in interface SharedSessionContract
HibernateException
public void delete(Object entity)
delete
in interface StatelessSession
public void delete(String entityName, Object entity)
delete
in interface StatelessSession
public Object get(Class entityClass, Serializable id, LockMode lockMode)
get
in interface StatelessSession
public Object get(Class entityClass, Serializable id)
get
in interface StatelessSession
public Object get(String entityName, Serializable id, LockMode lockMode)
get
in interface StatelessSession
public Object get(String entityName, Serializable id)
get
in interface StatelessSession
public Query getNamedQuery(String queryName) throws HibernateException
getNamedQuery
in interface SharedSessionContract
HibernateException
public Transaction getTransaction()
getTransaction
in interface SharedSessionContract
public Serializable insert(Object entity)
insert
in interface StatelessSession
public Serializable insert(String entityName, Object entity)
insert
in interface StatelessSession
public void refresh(Object entity, LockMode lockMode)
refresh
in interface StatelessSession
public void refresh(Object entity)
refresh
in interface StatelessSession
public void refresh(String entityName, Object entity, LockMode lockMode)
refresh
in interface StatelessSession
public void refresh(String entityName, Object entity)
refresh
in interface StatelessSession
public void update(Object entity)
update
in interface StatelessSession
public void update(String entityName, Object entity)
update
in interface StatelessSession
public String getTenantIdentifier()
getTenantIdentifier
in interface SharedSessionContract
public ProcedureCall getNamedProcedureCall(String name)
getNamedProcedureCall
in interface SharedSessionContract
public ProcedureCall createStoredProcedureCall(String name)
createStoredProcedureCall
in interface SharedSessionContract
public ProcedureCall createStoredProcedureCall(String paramString, Class... paramArrayOfClass)
createStoredProcedureCall
in interface SharedSessionContract
public ProcedureCall createStoredProcedureCall(String paramString, String... paramArrayOfString)
createStoredProcedureCall
in interface SharedSessionContract