com.ibatis.dao.client.template
Class HibernateDaoTemplate

java.lang.Object
  extended bycom.ibatis.dao.client.template.DaoTemplate
      extended bycom.ibatis.dao.client.template.HibernateDaoTemplate
All Implemented Interfaces:
Dao

public abstract class HibernateDaoTemplate
extends DaoTemplate

A DaoTemplate for Hibernate implementations that provides a convenient method to access the Hibernate Session.


Field Summary
 
Fields inherited from class com.ibatis.dao.client.template.DaoTemplate
daoManager
 
Constructor Summary
HibernateDaoTemplate(DaoManager daoManager)
          The DaoManager that manages this Dao instance will be passed in as the parameter to this constructor automatically upon instantiation.
 
Method Summary
 net.sf.hibernate.Transaction beginTransaction()
           
 void cancelQuery()
           
 void clear()
           
 java.sql.Connection close()
           
 java.sql.Connection connection()
           
 boolean contains(java.lang.Object o)
           
 net.sf.hibernate.Criteria createCriteria(java.lang.Class aClass)
           
 net.sf.hibernate.Query createFilter(java.lang.Object o, java.lang.String s)
           
 net.sf.hibernate.Query createQuery(java.lang.String s)
           
 net.sf.hibernate.Query createSQLQuery(java.lang.String s, java.lang.String[] strings, java.lang.Class[] classes)
           
 net.sf.hibernate.Query createSQLQuery(java.lang.String s, java.lang.String s1, java.lang.Class aClass)
           
 void delete(java.lang.Object o)
           
 int delete(java.lang.String s)
           
 int delete(java.lang.String s, java.lang.Object[] objects, net.sf.hibernate.type.Type[] types)
           
 int delete(java.lang.String s, java.lang.Object o, net.sf.hibernate.type.Type type)
           
 java.sql.Connection disconnect()
           
 void evict(java.lang.Object o)
           
 java.util.Collection filter(java.lang.Object o, java.lang.String s)
           
 java.util.Collection filter(java.lang.Object o, java.lang.String s, java.lang.Object[] objects, net.sf.hibernate.type.Type[] types)
           
 java.util.Collection filter(java.lang.Object o, java.lang.String s, java.lang.Object o1, net.sf.hibernate.type.Type type)
           
 java.util.List find(java.lang.String s)
           
 java.util.List find(java.lang.String s, java.lang.Object[] objects, net.sf.hibernate.type.Type[] types)
           
 java.util.List find(java.lang.String s, java.lang.Object o, net.sf.hibernate.type.Type type)
           
 void flush()
           
 java.lang.Object get(java.lang.Class aClass, java.io.Serializable serializable)
           
 java.lang.Object get(java.lang.Class aClass, java.io.Serializable serializable, net.sf.hibernate.LockMode lockMode)
           
 net.sf.hibernate.LockMode getCurrentLockMode(java.lang.Object o)
           
 net.sf.hibernate.FlushMode getFlushMode()
           
 java.io.Serializable getIdentifier(java.lang.Object o)
           
 net.sf.hibernate.Query getNamedQuery(java.lang.String s)
           
protected  net.sf.hibernate.Session getSession()
          Gets the Hibernate session associated with the current DaoTransaction that this Dao is working under.
 net.sf.hibernate.SessionFactory getSessionFactory()
           
 boolean isConnected()
           
 boolean isDirty()
           
 boolean isOpen()
           
 java.util.Iterator iterate(java.lang.String s)
           
 java.util.Iterator iterate(java.lang.String s, java.lang.Object[] objects, net.sf.hibernate.type.Type[] types)
           
 java.util.Iterator iterate(java.lang.String s, java.lang.Object o, net.sf.hibernate.type.Type type)
           
 java.lang.Object load(java.lang.Class aClass, java.io.Serializable serializable)
           
 java.lang.Object load(java.lang.Class aClass, java.io.Serializable serializable, net.sf.hibernate.LockMode lockMode)
           
 void load(java.lang.Object o, java.io.Serializable serializable)
           
 void lock(java.lang.Object o, net.sf.hibernate.LockMode lockMode)
           
 void reconnect()
           
 void reconnect(java.sql.Connection connection)
           
 void refresh(java.lang.Object o)
           
 void refresh(java.lang.Object o, net.sf.hibernate.LockMode lockMode)
           
 void replicate(java.lang.Object o, net.sf.hibernate.ReplicationMode replicationMode)
           
 java.io.Serializable save(java.lang.Object o)
           
 void save(java.lang.Object o, java.io.Serializable serializable)
           
 void saveOrUpdate(java.lang.Object o)
           
 java.lang.Object saveOrUpdateCopy(java.lang.Object o)
           
 java.lang.Object saveOrUpdateCopy(java.lang.Object o, java.io.Serializable serializable)
           
 void setFlushMode(net.sf.hibernate.FlushMode flushMode)
           
 void update(java.lang.Object o)
           
 void update(java.lang.Object o, java.io.Serializable serializable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateDaoTemplate

public HibernateDaoTemplate(DaoManager daoManager)
The DaoManager that manages this Dao instance will be passed in as the parameter to this constructor automatically upon instantiation.

Parameters:
daoManager -
Method Detail

getSession

protected net.sf.hibernate.Session getSession()
Gets the Hibernate session associated with the current DaoTransaction that this Dao is working under.

Returns:
A Hibernate Session instance.

flush

public void flush()

setFlushMode

public void setFlushMode(net.sf.hibernate.FlushMode flushMode)

getFlushMode

public net.sf.hibernate.FlushMode getFlushMode()

getSessionFactory

public net.sf.hibernate.SessionFactory getSessionFactory()

connection

public java.sql.Connection connection()

disconnect

public java.sql.Connection disconnect()

reconnect

public void reconnect()

reconnect

public void reconnect(java.sql.Connection connection)

close

public java.sql.Connection close()

cancelQuery

public void cancelQuery()

isOpen

public boolean isOpen()

isConnected

public boolean isConnected()

isDirty

public boolean isDirty()

getIdentifier

public java.io.Serializable getIdentifier(java.lang.Object o)

contains

public boolean contains(java.lang.Object o)

evict

public void evict(java.lang.Object o)

load

public java.lang.Object load(java.lang.Class aClass,
                             java.io.Serializable serializable,
                             net.sf.hibernate.LockMode lockMode)

load

public java.lang.Object load(java.lang.Class aClass,
                             java.io.Serializable serializable)

load

public void load(java.lang.Object o,
                 java.io.Serializable serializable)

replicate

public void replicate(java.lang.Object o,
                      net.sf.hibernate.ReplicationMode replicationMode)

save

public java.io.Serializable save(java.lang.Object o)

save

public void save(java.lang.Object o,
                 java.io.Serializable serializable)

saveOrUpdate

public void saveOrUpdate(java.lang.Object o)

update

public void update(java.lang.Object o)

update

public void update(java.lang.Object o,
                   java.io.Serializable serializable)

saveOrUpdateCopy

public java.lang.Object saveOrUpdateCopy(java.lang.Object o)

saveOrUpdateCopy

public java.lang.Object saveOrUpdateCopy(java.lang.Object o,
                                         java.io.Serializable serializable)

delete

public void delete(java.lang.Object o)

find

public java.util.List find(java.lang.String s)

find

public java.util.List find(java.lang.String s,
                           java.lang.Object o,
                           net.sf.hibernate.type.Type type)

find

public java.util.List find(java.lang.String s,
                           java.lang.Object[] objects,
                           net.sf.hibernate.type.Type[] types)

iterate

public java.util.Iterator iterate(java.lang.String s)

iterate

public java.util.Iterator iterate(java.lang.String s,
                                  java.lang.Object o,
                                  net.sf.hibernate.type.Type type)

iterate

public java.util.Iterator iterate(java.lang.String s,
                                  java.lang.Object[] objects,
                                  net.sf.hibernate.type.Type[] types)

filter

public java.util.Collection filter(java.lang.Object o,
                                   java.lang.String s)

filter

public java.util.Collection filter(java.lang.Object o,
                                   java.lang.String s,
                                   java.lang.Object o1,
                                   net.sf.hibernate.type.Type type)

filter

public java.util.Collection filter(java.lang.Object o,
                                   java.lang.String s,
                                   java.lang.Object[] objects,
                                   net.sf.hibernate.type.Type[] types)

delete

public int delete(java.lang.String s)

delete

public int delete(java.lang.String s,
                  java.lang.Object o,
                  net.sf.hibernate.type.Type type)

delete

public int delete(java.lang.String s,
                  java.lang.Object[] objects,
                  net.sf.hibernate.type.Type[] types)

lock

public void lock(java.lang.Object o,
                 net.sf.hibernate.LockMode lockMode)

refresh

public void refresh(java.lang.Object o)

refresh

public void refresh(java.lang.Object o,
                    net.sf.hibernate.LockMode lockMode)

getCurrentLockMode

public net.sf.hibernate.LockMode getCurrentLockMode(java.lang.Object o)

beginTransaction

public net.sf.hibernate.Transaction beginTransaction()

createCriteria

public net.sf.hibernate.Criteria createCriteria(java.lang.Class aClass)

createQuery

public net.sf.hibernate.Query createQuery(java.lang.String s)

createFilter

public net.sf.hibernate.Query createFilter(java.lang.Object o,
                                           java.lang.String s)

getNamedQuery

public net.sf.hibernate.Query getNamedQuery(java.lang.String s)

createSQLQuery

public net.sf.hibernate.Query createSQLQuery(java.lang.String s,
                                             java.lang.String s1,
                                             java.lang.Class aClass)

createSQLQuery

public net.sf.hibernate.Query createSQLQuery(java.lang.String s,
                                             java.lang.String[] strings,
                                             java.lang.Class[] classes)

clear

public void clear()

get

public java.lang.Object get(java.lang.Class aClass,
                            java.io.Serializable serializable)

get

public java.lang.Object get(java.lang.Class aClass,
                            java.io.Serializable serializable,
                            net.sf.hibernate.LockMode lockMode)