|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.hibernate.AbstractQueryCache net.sf.basedb.core.hibernate.StatelessSessionWrapper
public class StatelessSessionWrapper
Wrapper around stateless Hibernate sessions that includes a query cache. This wrapper forwards all calls to the underlying real Hibernate session.
Field Summary | |
---|---|
private static long |
serialVersionUID
|
private org.hibernate.StatelessSession |
session
|
Constructor Summary | |
---|---|
StatelessSessionWrapper(org.hibernate.StatelessSession session)
Creates a new session wrapper |
Method Summary | |
---|---|
org.hibernate.Transaction |
beginTransaction()
|
void |
cancelQuery()
Cancels the currently executing query in the same manner as Session.cancelQuery() . |
void |
close()
|
Connection |
connection()
|
org.hibernate.Criteria |
createCriteria(Class persistentClass)
|
org.hibernate.Criteria |
createCriteria(Class persistentClass,
String alias)
|
org.hibernate.Criteria |
createCriteria(String entityName)
|
org.hibernate.Criteria |
createCriteria(String entityName,
String alias)
|
org.hibernate.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. |
org.hibernate.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. |
void |
delete(Object entity)
|
void |
delete(String entityName,
Object entity)
|
Object |
get(Class entityClass,
Serializable id)
|
Object |
get(Class entityClass,
Serializable id,
org.hibernate.LockMode lockMode)
|
Object |
get(String entityName,
Serializable id)
|
Object |
get(String entityName,
Serializable id,
org.hibernate.LockMode lockMode)
|
org.hibernate.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. |
org.hibernate.StatelessSession |
getParentSession()
Get the underlying parent session from Hibernate. |
org.hibernate.Transaction |
getTransaction()
|
Serializable |
insert(Object entity)
|
Serializable |
insert(String entityName,
Object entity)
|
void |
refresh(Object entity)
|
void |
refresh(Object entity,
org.hibernate.LockMode lockMode)
|
void |
refresh(String entityName,
Object entity)
|
void |
refresh(String entityName,
Object entity,
org.hibernate.LockMode lockMode)
|
void |
update(Object entity)
|
void |
update(String entityName,
Object entity)
|
Methods inherited from class net.sf.basedb.core.hibernate.AbstractQueryCache |
---|
cacheQuery, getCachedQuery |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private final org.hibernate.StatelessSession session
Constructor Detail |
---|
public StatelessSessionWrapper(org.hibernate.StatelessSession session)
session
- The real Hibernate sessionMethod Detail |
---|
public org.hibernate.StatelessSession getParentSession()
public void cancelQuery() throws org.hibernate.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.
org.hibernate.HibernateException
public org.hibernate.Transaction beginTransaction()
beginTransaction
in interface org.hibernate.StatelessSession
public void close()
close
in interface org.hibernate.StatelessSession
public Connection connection()
connection
in interface org.hibernate.StatelessSession
public org.hibernate.Criteria createCriteria(Class persistentClass, String alias)
createCriteria
in interface org.hibernate.StatelessSession
public org.hibernate.Criteria createCriteria(Class persistentClass)
createCriteria
in interface org.hibernate.StatelessSession
public org.hibernate.Criteria createCriteria(String entityName, String alias)
createCriteria
in interface org.hibernate.StatelessSession
public org.hibernate.Criteria createCriteria(String entityName)
createCriteria
in interface org.hibernate.StatelessSession
public org.hibernate.Query createQuery(String queryString) throws org.hibernate.HibernateException
createQuery
in interface org.hibernate.StatelessSession
org.hibernate.HibernateException
public org.hibernate.SQLQuery createSQLQuery(String queryString) throws org.hibernate.HibernateException
createSQLQuery
in interface org.hibernate.StatelessSession
org.hibernate.HibernateException
public void delete(Object entity)
delete
in interface org.hibernate.StatelessSession
public void delete(String entityName, Object entity)
delete
in interface org.hibernate.StatelessSession
public Object get(Class entityClass, Serializable id, org.hibernate.LockMode lockMode)
get
in interface org.hibernate.StatelessSession
public Object get(Class entityClass, Serializable id)
get
in interface org.hibernate.StatelessSession
public Object get(String entityName, Serializable id, org.hibernate.LockMode lockMode)
get
in interface org.hibernate.StatelessSession
public Object get(String entityName, Serializable id)
get
in interface org.hibernate.StatelessSession
public org.hibernate.Query getNamedQuery(String queryName) throws org.hibernate.HibernateException
getNamedQuery
in interface org.hibernate.StatelessSession
org.hibernate.HibernateException
public org.hibernate.Transaction getTransaction()
getTransaction
in interface org.hibernate.StatelessSession
public Serializable insert(Object entity)
insert
in interface org.hibernate.StatelessSession
public Serializable insert(String entityName, Object entity)
insert
in interface org.hibernate.StatelessSession
public void refresh(Object entity, org.hibernate.LockMode lockMode)
refresh
in interface org.hibernate.StatelessSession
public void refresh(Object entity)
refresh
in interface org.hibernate.StatelessSession
public void refresh(String entityName, Object entity, org.hibernate.LockMode lockMode)
refresh
in interface org.hibernate.StatelessSession
public void refresh(String entityName, Object entity)
refresh
in interface org.hibernate.StatelessSession
public void update(Object entity)
update
in interface org.hibernate.StatelessSession
public void update(String entityName, Object entity)
update
in interface org.hibernate.StatelessSession
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |