|
3.0.4: 2012-03-05 | ||||||||
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 sessionMethod Detail |
---|
public Session getParentSession()
public Transaction beginTransaction() throws HibernateException
beginTransaction
in interface Session
HibernateException
public Session.LockRequest buildLockRequest(LockOptions options)
buildLockRequest
in interface Session
public void cancelQuery() throws HibernateException
cancelQuery
in interface Session
HibernateException
public void clear()
clear
in interface Session
public Connection close() throws HibernateException
close
in interface Session
HibernateException
@Deprecated public Connection connection() throws HibernateException
connection
in interface Session
HibernateException
public boolean contains(Object object)
contains
in interface Session
public Criteria createCriteria(Class persistentClass, String alias)
createCriteria
in interface Session
public Criteria createCriteria(Class persistentClass)
createCriteria
in interface Session
public Criteria createCriteria(String entityName, String alias)
createCriteria
in interface Session
public Criteria createCriteria(String entityName)
createCriteria
in interface Session
public Query createFilter(Object collection, String queryString) throws HibernateException
createFilter
in interface Session
HibernateException
public Query createQuery(String queryString) throws HibernateException
createQuery
in interface Session
HibernateException
public SQLQuery createSQLQuery(String queryString) throws HibernateException
createSQLQuery
in interface Session
HibernateException
public void delete(Object object) throws HibernateException
delete
in interface Session
HibernateException
public void delete(String entityName, Object object) throws HibernateException
delete
in interface Session
HibernateException
public void disableFetchProfile(String name) throws UnknownProfileException
disableFetchProfile
in interface Session
UnknownProfileException
public void disableFilter(String filterName)
disableFilter
in interface Session
public Connection disconnect() throws HibernateException
disconnect
in interface Session
HibernateException
public void doWork(Work work) throws HibernateException
doWork
in interface Session
HibernateException
public void enableFetchProfile(String name) throws UnknownProfileException
enableFetchProfile
in interface Session
UnknownProfileException
public Filter enableFilter(String filterName)
enableFilter
in interface Session
public void evict(Object object) throws HibernateException
evict
in interface Session
HibernateException
public void flush() throws HibernateException
flush
in interface Session
HibernateException
@Deprecated public Object get(Class clazz, Serializable id, LockMode lockMode) throws HibernateException
get
in interface Session
HibernateException
public Object get(Class clazz, Serializable id, LockOptions lockOptions) throws HibernateException
get
in interface Session
HibernateException
public Object get(Class clazz, Serializable id) throws HibernateException
get
in interface Session
HibernateException
@Deprecated public Object get(String entityName, Serializable id, LockMode lockMode) throws HibernateException
get
in interface Session
HibernateException
public Object get(String entityName, Serializable id, LockOptions lockOptions) throws HibernateException
get
in interface Session
HibernateException
public Object get(String entityName, Serializable id) throws HibernateException
get
in interface Session
HibernateException
public CacheMode getCacheMode()
getCacheMode
in interface Session
public LockMode getCurrentLockMode(Object object) throws HibernateException
getCurrentLockMode
in interface Session
HibernateException
public Filter getEnabledFilter(String filterName)
getEnabledFilter
in interface Session
public EntityMode getEntityMode()
getEntityMode
in interface Session
public String getEntityName(Object object) throws HibernateException
getEntityName
in interface Session
HibernateException
public FlushMode getFlushMode()
getFlushMode
in interface Session
public Serializable getIdentifier(Object object) throws HibernateException
getIdentifier
in interface Session
HibernateException
public LobHelper getLobHelper()
getLobHelper
in interface Session
public Query getNamedQuery(String queryName) throws HibernateException
getNamedQuery
in interface Session
HibernateException
public Session getSession(EntityMode entityMode)
getSession
in interface Session
public SessionFactory getSessionFactory()
getSessionFactory
in interface Session
public SessionStatistics getStatistics()
getStatistics
in interface Session
public Transaction getTransaction()
getTransaction
in interface Session
public TypeHelper getTypeHelper()
getTypeHelper
in interface Session
public boolean isConnected()
isConnected
in interface Session
public boolean isDefaultReadOnly()
isDefaultReadOnly
in interface Session
public boolean isDirty() throws HibernateException
isDirty
in interface Session
HibernateException
public boolean isFetchProfileEnabled(String name) throws UnknownProfileException
isFetchProfileEnabled
in interface Session
UnknownProfileException
public boolean isOpen()
isOpen
in interface Session
public boolean isReadOnly(Object entityOrProxy)
isReadOnly
in interface Session
@Deprecated public Object load(Class theClass, Serializable id, LockMode lockMode) throws HibernateException
load
in interface Session
HibernateException
public Object load(Class theClass, Serializable id, LockOptions lockOptions) throws HibernateException
load
in interface Session
HibernateException
public Object load(Class theClass, Serializable id) throws HibernateException
load
in interface Session
HibernateException
public void load(Object object, Serializable id) throws HibernateException
load
in interface Session
HibernateException
@Deprecated public Object load(String entityName, Serializable id, LockMode lockMode) throws HibernateException
load
in interface Session
HibernateException
public Object load(String entityName, Serializable id, LockOptions lockOptions) throws HibernateException
load
in interface Session
HibernateException
public Object load(String entityName, Serializable id) throws HibernateException
load
in interface Session
HibernateException
@Deprecated public void lock(Object object, LockMode lockMode) throws HibernateException
lock
in interface Session
HibernateException
@Deprecated public void lock(String entityName, Object object, LockMode lockMode) throws HibernateException
lock
in interface Session
HibernateException
public Object merge(Object object) throws HibernateException
merge
in interface Session
HibernateException
public Object merge(String entityName, Object object) throws HibernateException
merge
in interface Session
HibernateException
public void persist(Object object) throws HibernateException
persist
in interface Session
HibernateException
public void persist(String entityName, Object object) throws HibernateException
persist
in interface Session
HibernateException
@Deprecated public void reconnect() throws HibernateException
reconnect
in interface Session
HibernateException
public void reconnect(Connection connection) throws HibernateException
reconnect
in interface Session
HibernateException
@Deprecated public void refresh(Object object, LockMode lockMode) throws HibernateException
refresh
in interface Session
HibernateException
public void refresh(Object object, LockOptions lockOptions) throws HibernateException
refresh
in interface Session
HibernateException
public void refresh(Object object) throws HibernateException
refresh
in interface Session
HibernateException
public void replicate(Object object, ReplicationMode replicationMode) throws HibernateException
replicate
in interface Session
HibernateException
public void replicate(String entityName, Object object, ReplicationMode replicationMode) throws HibernateException
replicate
in interface Session
HibernateException
public Serializable save(Object object) throws HibernateException
save
in interface Session
HibernateException
public Serializable save(String entityName, Object object) throws HibernateException
save
in interface Session
HibernateException
public void saveOrUpdate(Object object) throws HibernateException
saveOrUpdate
in interface Session
HibernateException
public void saveOrUpdate(String entityName, Object object) throws HibernateException
saveOrUpdate
in interface Session
HibernateException
public void setCacheMode(CacheMode cacheMode)
setCacheMode
in interface Session
public void setDefaultReadOnly(boolean readOnly)
setDefaultReadOnly
in interface Session
public 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 Session
HibernateException
public void update(String entityName, Object object) throws HibernateException
update
in interface Session
HibernateException
|
3.0.4: 2012-03-05 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |