|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.basedb.core.hibernate.AbstractQueryCache
net.sf.basedb.core.hibernate.SessionWrapper
public class SessionWrapper
Wrapper around Hibernate sessions that includes a query cache. This wrapper forwards all calls to the underlying real Hibernate session.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.hibernate.Session |
|---|
Session.LockRequest |
| Field Summary | |
|---|---|
private static long |
serialVersionUID
|
private Session |
session
|
| Constructor Summary | |
|---|---|
SessionWrapper(Session session)
Creates a new session wrapper |
|
| Method Summary | |
|---|---|
Transaction |
beginTransaction()
|
Session.LockRequest |
buildLockRequest(LockOptions options)
|
void |
cancelQuery()
|
void |
clear()
|
Connection |
close()
|
Connection |
connection()
Deprecated. |
boolean |
contains(Object object)
|
Criteria |
createCriteria(Class persistentClass)
|
Criteria |
createCriteria(Class persistentClass,
String alias)
|
Criteria |
createCriteria(String entityName)
|
Criteria |
createCriteria(String entityName,
String alias)
|
Query |
createFilter(Object collection,
String queryString)
|
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. |
void |
delete(Object object)
|
void |
delete(String entityName,
Object object)
|
void |
disableFetchProfile(String name)
|
void |
disableFilter(String filterName)
|
Connection |
disconnect()
|
void |
doWork(Work work)
|
void |
enableFetchProfile(String name)
|
Filter |
enableFilter(String filterName)
|
void |
evict(Object object)
|
void |
flush()
|
Object |
get(Class clazz,
Serializable id)
|
Object |
get(Class clazz,
Serializable id,
LockMode lockMode)
Deprecated. |
Object |
get(Class clazz,
Serializable id,
LockOptions lockOptions)
|
Object |
get(String entityName,
Serializable id)
|
Object |
get(String entityName,
Serializable id,
LockMode lockMode)
Deprecated. |
Object |
get(String entityName,
Serializable id,
LockOptions lockOptions)
|
CacheMode |
getCacheMode()
|
LockMode |
getCurrentLockMode(Object object)
|
Filter |
getEnabledFilter(String filterName)
|
EntityMode |
getEntityMode()
|
String |
getEntityName(Object object)
|
FlushMode |
getFlushMode()
|
Serializable |
getIdentifier(Object object)
|
LobHelper |
getLobHelper()
|
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. |
Session |
getParentSession()
Get the underlying parent session from Hibernate. |
Session |
getSession(EntityMode entityMode)
|
SessionFactory |
getSessionFactory()
|
SessionStatistics |
getStatistics()
|
Transaction |
getTransaction()
|
TypeHelper |
getTypeHelper()
|
boolean |
isConnected()
|
boolean |
isDefaultReadOnly()
|
boolean |
isDirty()
|
boolean |
isFetchProfileEnabled(String name)
|
boolean |
isOpen()
|
boolean |
isReadOnly(Object entityOrProxy)
|
Object |
load(Class theClass,
Serializable id)
|
Object |
load(Class theClass,
Serializable id,
LockMode lockMode)
Deprecated. |
Object |
load(Class theClass,
Serializable id,
LockOptions lockOptions)
|
void |
load(Object object,
Serializable id)
|
Object |
load(String entityName,
Serializable id)
|
Object |
load(String entityName,
Serializable id,
LockMode lockMode)
Deprecated. |
Object |
load(String entityName,
Serializable id,
LockOptions lockOptions)
|
void |
lock(Object object,
LockMode lockMode)
Deprecated. |
void |
lock(String entityName,
Object object,
LockMode lockMode)
Deprecated. |
Object |
merge(Object object)
|
Object |
merge(String entityName,
Object object)
|
void |
persist(Object object)
|
void |
persist(String entityName,
Object object)
|
void |
reconnect()
Deprecated. |
void |
reconnect(Connection connection)
|
void |
refresh(Object object)
|
void |
refresh(Object object,
LockMode lockMode)
Deprecated. |
void |
refresh(Object object,
LockOptions lockOptions)
|
void |
replicate(Object object,
ReplicationMode replicationMode)
|
void |
replicate(String entityName,
Object object,
ReplicationMode replicationMode)
|
Serializable |
save(Object object)
|
Serializable |
save(String entityName,
Object object)
|
void |
saveOrUpdate(Object object)
|
void |
saveOrUpdate(String entityName,
Object object)
|
void |
setCacheMode(CacheMode cacheMode)
|
void |
setDefaultReadOnly(boolean readOnly)
|
void |
setFlushMode(FlushMode flushMode)
|
void |
setReadOnly(Object entityOrProxy,
boolean readOnly)
|
void |
update(Object object)
|
void |
update(String entityName,
Object object)
|
| 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 Session session
| Constructor Detail |
|---|
public SessionWrapper(Session session)
session - The real Hibernate session| Method Detail |
|---|
public Session getParentSession()
public Transaction beginTransaction()
throws HibernateException
beginTransaction in interface SessionHibernateExceptionpublic Session.LockRequest buildLockRequest(LockOptions options)
buildLockRequest in interface Session
public void cancelQuery()
throws HibernateException
cancelQuery in interface SessionHibernateExceptionpublic void clear()
clear in interface Session
public Connection close()
throws HibernateException
close in interface SessionHibernateException
@Deprecated
public Connection connection()
throws HibernateException
connection in interface SessionHibernateExceptionpublic boolean contains(Object object)
contains in interface Session
public Criteria createCriteria(Class persistentClass,
String alias)
createCriteria in interface Sessionpublic Criteria createCriteria(Class persistentClass)
createCriteria in interface Session
public Criteria createCriteria(String entityName,
String alias)
createCriteria in interface Sessionpublic Criteria createCriteria(String entityName)
createCriteria in interface Session
public Query createFilter(Object collection,
String queryString)
throws HibernateException
createFilter in interface SessionHibernateException
public Query createQuery(String queryString)
throws HibernateException
createQuery in interface SessionHibernateException
public SQLQuery createSQLQuery(String queryString)
throws HibernateException
createSQLQuery in interface SessionHibernateException
public void delete(Object object)
throws HibernateException
delete in interface SessionHibernateException
public void delete(String entityName,
Object object)
throws HibernateException
delete in interface SessionHibernateException
public void disableFetchProfile(String name)
throws UnknownProfileException
disableFetchProfile in interface SessionUnknownProfileExceptionpublic void disableFilter(String filterName)
disableFilter in interface Session
public Connection disconnect()
throws HibernateException
disconnect in interface SessionHibernateException
public void doWork(Work work)
throws HibernateException
doWork in interface SessionHibernateException
public void enableFetchProfile(String name)
throws UnknownProfileException
enableFetchProfile in interface SessionUnknownProfileExceptionpublic Filter enableFilter(String filterName)
enableFilter in interface Session
public void evict(Object object)
throws HibernateException
evict in interface SessionHibernateException
public void flush()
throws HibernateException
flush in interface SessionHibernateException
@Deprecated
public Object get(Class clazz,
Serializable id,
LockMode lockMode)
throws HibernateException
get in interface SessionHibernateException
public Object get(Class clazz,
Serializable id,
LockOptions lockOptions)
throws HibernateException
get in interface SessionHibernateException
public Object get(Class clazz,
Serializable id)
throws HibernateException
get in interface SessionHibernateException
@Deprecated
public Object get(String entityName,
Serializable id,
LockMode lockMode)
throws HibernateException
get in interface SessionHibernateException
public Object get(String entityName,
Serializable id,
LockOptions lockOptions)
throws HibernateException
get in interface SessionHibernateException
public Object get(String entityName,
Serializable id)
throws HibernateException
get in interface SessionHibernateExceptionpublic CacheMode getCacheMode()
getCacheMode in interface Session
public LockMode getCurrentLockMode(Object object)
throws HibernateException
getCurrentLockMode in interface SessionHibernateExceptionpublic Filter getEnabledFilter(String filterName)
getEnabledFilter in interface Sessionpublic EntityMode getEntityMode()
getEntityMode in interface Session
public String getEntityName(Object object)
throws HibernateException
getEntityName in interface SessionHibernateExceptionpublic FlushMode getFlushMode()
getFlushMode in interface Session
public Serializable getIdentifier(Object object)
throws HibernateException
getIdentifier in interface SessionHibernateExceptionpublic LobHelper getLobHelper()
getLobHelper in interface Session
public Query getNamedQuery(String queryName)
throws HibernateException
getNamedQuery in interface SessionHibernateExceptionpublic Session getSession(EntityMode entityMode)
getSession in interface Sessionpublic SessionFactory getSessionFactory()
getSessionFactory in interface Sessionpublic SessionStatistics getStatistics()
getStatistics in interface Sessionpublic Transaction getTransaction()
getTransaction in interface Sessionpublic TypeHelper getTypeHelper()
getTypeHelper in interface Sessionpublic boolean isConnected()
isConnected in interface Sessionpublic boolean isDefaultReadOnly()
isDefaultReadOnly in interface Session
public boolean isDirty()
throws HibernateException
isDirty in interface SessionHibernateException
public boolean isFetchProfileEnabled(String name)
throws UnknownProfileException
isFetchProfileEnabled in interface SessionUnknownProfileExceptionpublic boolean isOpen()
isOpen in interface Sessionpublic boolean isReadOnly(Object entityOrProxy)
isReadOnly in interface Session
@Deprecated
public Object load(Class theClass,
Serializable id,
LockMode lockMode)
throws HibernateException
load in interface SessionHibernateException
public Object load(Class theClass,
Serializable id,
LockOptions lockOptions)
throws HibernateException
load in interface SessionHibernateException
public Object load(Class theClass,
Serializable id)
throws HibernateException
load in interface SessionHibernateException
public void load(Object object,
Serializable id)
throws HibernateException
load in interface SessionHibernateException
@Deprecated
public Object load(String entityName,
Serializable id,
LockMode lockMode)
throws HibernateException
load in interface SessionHibernateException
public Object load(String entityName,
Serializable id,
LockOptions lockOptions)
throws HibernateException
load in interface SessionHibernateException
public Object load(String entityName,
Serializable id)
throws HibernateException
load in interface SessionHibernateException
@Deprecated
public void lock(Object object,
LockMode lockMode)
throws HibernateException
lock in interface SessionHibernateException
@Deprecated
public void lock(String entityName,
Object object,
LockMode lockMode)
throws HibernateException
lock in interface SessionHibernateException
public Object merge(Object object)
throws HibernateException
merge in interface SessionHibernateException
public Object merge(String entityName,
Object object)
throws HibernateException
merge in interface SessionHibernateException
public void persist(Object object)
throws HibernateException
persist in interface SessionHibernateException
public void persist(String entityName,
Object object)
throws HibernateException
persist in interface SessionHibernateException
@Deprecated
public void reconnect()
throws HibernateException
reconnect in interface SessionHibernateException
public void reconnect(Connection connection)
throws HibernateException
reconnect in interface SessionHibernateException
@Deprecated
public void refresh(Object object,
LockMode lockMode)
throws HibernateException
refresh in interface SessionHibernateException
public void refresh(Object object,
LockOptions lockOptions)
throws HibernateException
refresh in interface SessionHibernateException
public void refresh(Object object)
throws HibernateException
refresh in interface SessionHibernateException
public void replicate(Object object,
ReplicationMode replicationMode)
throws HibernateException
replicate in interface SessionHibernateException
public void replicate(String entityName,
Object object,
ReplicationMode replicationMode)
throws HibernateException
replicate in interface SessionHibernateException
public Serializable save(Object object)
throws HibernateException
save in interface SessionHibernateException
public Serializable save(String entityName,
Object object)
throws HibernateException
save in interface SessionHibernateException
public void saveOrUpdate(Object object)
throws HibernateException
saveOrUpdate in interface SessionHibernateException
public void saveOrUpdate(String entityName,
Object object)
throws HibernateException
saveOrUpdate in interface SessionHibernateExceptionpublic void setCacheMode(CacheMode cacheMode)
setCacheMode in interface Sessionpublic void setDefaultReadOnly(boolean readOnly)
setDefaultReadOnly in interface Sessionpublic void setFlushMode(FlushMode flushMode)
setFlushMode in interface Session
public void setReadOnly(Object entityOrProxy,
boolean readOnly)
setReadOnly in interface Session
public void update(Object object)
throws HibernateException
update in interface SessionHibernateException
public void update(String entityName,
Object object)
throws HibernateException
update in interface SessionHibernateException
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||