|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nanocontainer.persistence.hibernate.classic.SessionDelegator
public abstract class SessionDelegator
Abstract base class for session delegators, which delegates all calls to session obtained by implementing class. Also does error handling. All methods are just delegations to a Hibernate session.
| Constructor Summary | |
|---|---|
SessionDelegator()
|
|
SessionDelegator(HibernateExceptionHandler exceptionHandler)
|
|
| Method Summary | |
|---|---|
net.sf.hibernate.Transaction |
beginTransaction()
|
void |
cancelQuery()
|
void |
clear()
|
Connection |
close()
|
Connection |
connection()
|
boolean |
contains(Object object)
|
net.sf.hibernate.Criteria |
createCriteria(Class persistentClass)
|
net.sf.hibernate.Query |
createFilter(Object collection,
String queryString)
|
net.sf.hibernate.Query |
createQuery(String queryString)
|
net.sf.hibernate.Query |
createSQLQuery(String sql,
String[] returnAliases,
Class[] returnClasses)
|
net.sf.hibernate.Query |
createSQLQuery(String sql,
String returnAlias,
Class returnClass)
|
void |
delete(Object object)
|
int |
delete(String query)
|
int |
delete(String query,
Object[] values,
net.sf.hibernate.type.Type[] types)
|
int |
delete(String query,
Object value,
net.sf.hibernate.type.Type type)
|
Connection |
disconnect()
|
void |
evict(Object object)
|
Collection |
filter(Object collection,
String filter)
|
Collection |
filter(Object collection,
String filter,
Object[] values,
net.sf.hibernate.type.Type[] types)
|
Collection |
filter(Object collection,
String filter,
Object value,
net.sf.hibernate.type.Type type)
|
List |
find(String query)
|
List |
find(String query,
Object[] values,
net.sf.hibernate.type.Type[] types)
|
List |
find(String query,
Object value,
net.sf.hibernate.type.Type type)
|
void |
flush()
|
Object |
get(Class clazz,
Serializable id)
|
Object |
get(Class clazz,
Serializable id,
net.sf.hibernate.LockMode lockMode)
|
net.sf.hibernate.LockMode |
getCurrentLockMode(Object object)
|
protected abstract net.sf.hibernate.Session |
getDelegatedSession()
obtain hibernate session. |
net.sf.hibernate.FlushMode |
getFlushMode()
|
Serializable |
getIdentifier(Object object)
|
net.sf.hibernate.Query |
getNamedQuery(String queryName)
|
net.sf.hibernate.SessionFactory |
getSessionFactory()
|
protected RuntimeException |
handleException(net.sf.hibernate.HibernateException cause)
Invalidates the session calling invalidateDelegatedSession() and convert the cause using
a ExceptionHandler if it's available otherwise throws the cause back. |
protected RuntimeException |
handleException(RuntimeException cause)
Invalidates the session calling invalidateDelegatedSession() and convert the cause using
a ExceptionHandler if it's available otherwise just return the cause back. |
protected abstract void |
invalidateDelegatedSession()
perform actions to dispose "burned" session properly |
boolean |
isConnected()
|
boolean |
isDirty()
|
boolean |
isOpen()
|
Iterator |
iterate(String query)
|
Iterator |
iterate(String query,
Object[] values,
net.sf.hibernate.type.Type[] types)
|
Iterator |
iterate(String query,
Object value,
net.sf.hibernate.type.Type type)
|
Object |
load(Class theClass,
Serializable id)
|
Object |
load(Class theClass,
Serializable id,
net.sf.hibernate.LockMode lockMode)
|
void |
load(Object object,
Serializable id)
|
void |
lock(Object object,
net.sf.hibernate.LockMode lockMode)
|
void |
reconnect()
|
void |
reconnect(Connection connection)
|
void |
refresh(Object object)
|
void |
refresh(Object object,
net.sf.hibernate.LockMode lockMode)
|
void |
replicate(Object object,
net.sf.hibernate.ReplicationMode replicationMode)
|
Serializable |
save(Object object)
|
void |
save(Object object,
Serializable id)
|
void |
saveOrUpdate(Object object)
|
Object |
saveOrUpdateCopy(Object object)
|
Object |
saveOrUpdateCopy(Object object,
Serializable id)
|
void |
setFlushMode(net.sf.hibernate.FlushMode flushMode)
|
void |
update(Object object)
|
void |
update(Object object,
Serializable id)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SessionDelegator()
public SessionDelegator(HibernateExceptionHandler exceptionHandler)
exceptionHandler - Exception handler component to use with created session| Method Detail |
|---|
protected abstract net.sf.hibernate.Session getDelegatedSession()
protected abstract void invalidateDelegatedSession()
throws net.sf.hibernate.HibernateException
net.sf.hibernate.HibernateException
protected RuntimeException handleException(net.sf.hibernate.HibernateException cause)
throws net.sf.hibernate.HibernateException
invalidateDelegatedSession() and convert the cause using
a ExceptionHandler if it's available otherwise throws the cause back.
net.sf.hibernate.HibernateExceptionprotected RuntimeException handleException(RuntimeException cause)
invalidateDelegatedSession() and convert the cause using
a ExceptionHandler if it's available otherwise just return the cause back.
public void flush()
throws net.sf.hibernate.HibernateException
flush in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateExceptionpublic void setFlushMode(net.sf.hibernate.FlushMode flushMode)
setFlushMode in interface net.sf.hibernate.Sessionpublic net.sf.hibernate.FlushMode getFlushMode()
getFlushMode in interface net.sf.hibernate.Sessionpublic net.sf.hibernate.SessionFactory getSessionFactory()
getSessionFactory in interface net.sf.hibernate.Session
public Connection connection()
throws net.sf.hibernate.HibernateException
connection in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Connection disconnect()
throws net.sf.hibernate.HibernateException
disconnect in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void reconnect()
throws net.sf.hibernate.HibernateException
reconnect in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void reconnect(Connection connection)
throws net.sf.hibernate.HibernateException
reconnect in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Connection close()
throws net.sf.hibernate.HibernateException
close in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void cancelQuery()
throws net.sf.hibernate.HibernateException
cancelQuery in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateExceptionpublic boolean isOpen()
isOpen in interface net.sf.hibernate.Sessionpublic boolean isConnected()
isConnected in interface net.sf.hibernate.Session
public boolean isDirty()
throws net.sf.hibernate.HibernateException
isDirty in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Serializable getIdentifier(Object object)
throws net.sf.hibernate.HibernateException
getIdentifier in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateExceptionpublic boolean contains(Object object)
contains in interface net.sf.hibernate.Session
public void evict(Object object)
throws net.sf.hibernate.HibernateException
evict in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Object load(Class theClass,
Serializable id,
net.sf.hibernate.LockMode lockMode)
throws net.sf.hibernate.HibernateException
load in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Object load(Class theClass,
Serializable id)
throws net.sf.hibernate.HibernateException
load in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void load(Object object,
Serializable id)
throws net.sf.hibernate.HibernateException
load in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void replicate(Object object,
net.sf.hibernate.ReplicationMode replicationMode)
throws net.sf.hibernate.HibernateException
replicate in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Serializable save(Object object)
throws net.sf.hibernate.HibernateException
save in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void save(Object object,
Serializable id)
throws net.sf.hibernate.HibernateException
save in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void saveOrUpdate(Object object)
throws net.sf.hibernate.HibernateException
saveOrUpdate in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void update(Object object)
throws net.sf.hibernate.HibernateException
update in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void update(Object object,
Serializable id)
throws net.sf.hibernate.HibernateException
update in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Object saveOrUpdateCopy(Object object)
throws net.sf.hibernate.HibernateException
saveOrUpdateCopy in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Object saveOrUpdateCopy(Object object,
Serializable id)
throws net.sf.hibernate.HibernateException
saveOrUpdateCopy in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void delete(Object object)
throws net.sf.hibernate.HibernateException
delete in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public List find(String query)
throws net.sf.hibernate.HibernateException
find in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public List find(String query,
Object value,
net.sf.hibernate.type.Type type)
throws net.sf.hibernate.HibernateException
find in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public List find(String query,
Object[] values,
net.sf.hibernate.type.Type[] types)
throws net.sf.hibernate.HibernateException
find in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Iterator iterate(String query)
throws net.sf.hibernate.HibernateException
iterate in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Iterator iterate(String query,
Object value,
net.sf.hibernate.type.Type type)
throws net.sf.hibernate.HibernateException
iterate in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Iterator iterate(String query,
Object[] values,
net.sf.hibernate.type.Type[] types)
throws net.sf.hibernate.HibernateException
iterate in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Collection filter(Object collection,
String filter)
throws net.sf.hibernate.HibernateException
filter in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Collection filter(Object collection,
String filter,
Object value,
net.sf.hibernate.type.Type type)
throws net.sf.hibernate.HibernateException
filter in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Collection filter(Object collection,
String filter,
Object[] values,
net.sf.hibernate.type.Type[] types)
throws net.sf.hibernate.HibernateException
filter in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public int delete(String query)
throws net.sf.hibernate.HibernateException
delete in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public int delete(String query,
Object value,
net.sf.hibernate.type.Type type)
throws net.sf.hibernate.HibernateException
delete in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public int delete(String query,
Object[] values,
net.sf.hibernate.type.Type[] types)
throws net.sf.hibernate.HibernateException
delete in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void lock(Object object,
net.sf.hibernate.LockMode lockMode)
throws net.sf.hibernate.HibernateException
lock in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void refresh(Object object)
throws net.sf.hibernate.HibernateException
refresh in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public void refresh(Object object,
net.sf.hibernate.LockMode lockMode)
throws net.sf.hibernate.HibernateException
refresh in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public net.sf.hibernate.LockMode getCurrentLockMode(Object object)
throws net.sf.hibernate.HibernateException
getCurrentLockMode in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public net.sf.hibernate.Transaction beginTransaction()
throws net.sf.hibernate.HibernateException
beginTransaction in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateExceptionpublic net.sf.hibernate.Criteria createCriteria(Class persistentClass)
createCriteria in interface net.sf.hibernate.Session
public net.sf.hibernate.Query createQuery(String queryString)
throws net.sf.hibernate.HibernateException
createQuery in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public net.sf.hibernate.Query createFilter(Object collection,
String queryString)
throws net.sf.hibernate.HibernateException
createFilter in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public net.sf.hibernate.Query getNamedQuery(String queryName)
throws net.sf.hibernate.HibernateException
getNamedQuery in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public net.sf.hibernate.Query createSQLQuery(String sql,
String returnAlias,
Class returnClass)
createSQLQuery in interface net.sf.hibernate.Session
public net.sf.hibernate.Query createSQLQuery(String sql,
String[] returnAliases,
Class[] returnClasses)
createSQLQuery in interface net.sf.hibernate.Sessionpublic void clear()
clear in interface net.sf.hibernate.Session
public Object get(Class clazz,
Serializable id)
throws net.sf.hibernate.HibernateException
get in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
public Object get(Class clazz,
Serializable id,
net.sf.hibernate.LockMode lockMode)
throws net.sf.hibernate.HibernateException
get in interface net.sf.hibernate.Sessionnet.sf.hibernate.HibernateException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||