org.opennms.netmgt.dao.hibernate
Class AbstractDaoHibernate<T,K extends Serializable>

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate<T,K>
All Implemented Interfaces:
OnmsDao<T,K>, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
AbstractCachingDaoHibernate, AcknowledgmentDaoHibernate, AlarmDaoHibernate, ApplicationDaoHibernate, AssetRecordDaoHibernate, AvailabilityReportLocatorDaoHibernate, DataLinkInterfaceDaoHibernate, DemandPollDaoHibernate, EventDaoHibernate, IpInterfaceDaoHibernate, LocationMonitorDaoHibernate, MonitoredServiceDaoHibernate, NodeDaoHibernate, NotificationDaoHibernate, OnmsMapDaoHibernate, OnmsMapElementDaoHibernate, OutageDaoHibernate, ResourceReferenceDaoHibernate, SnmpInterfaceDaoHibernate, StatisticsReportDaoHibernate, StatisticsReportDataDaoHibernate, UserNotificationDaoHibernate

public abstract class AbstractDaoHibernate<T,K extends Serializable>
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements OnmsDao<T,K>


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
AbstractDaoHibernate(Class<T> entityClass)
           
 
Method Summary
 int bulkDelete(String hql, Object[] values)
           
 void clear()
           
 int countAll()
           
 int countMatching(OnmsCriteria onmsCrit)
           
 void delete(T entity)
           
 void deleteAll(Collection<T> entities)
           
 void evict(T entity)
           
 List<T> find(String query)
           
 List<T> find(String query, Object... values)
           
 List<T> findAll()
           
 List<T> findMatching(OnmsCriteria onmsCrit)
           
<S> List<S>
findMatchingObjects(Class<S> type, OnmsCriteria onmsCrit)
           
<S> List<S>
findObjects(Class<S> clazz, String query, Object... values)
           
protected
<S> S
findUnique(Class<? extends S> type, String queryString, Object... args)
           
protected  T findUnique(String query)
           
protected  T findUnique(String queryString, Object... args)
           
 void flush()
           
 T get(K id)
           
 void initialize(Object obj)
           
 T load(K id)
           
 void merge(T entity)
           
protected  int queryInt(String query)
           
protected  int queryInt(String queryString, Object... args)
           
 void save(T entity)
           
 void saveOrUpdate(T entity)
           
 void update(T entity)
           
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDaoHibernate

public AbstractDaoHibernate(Class<T> entityClass)
Method Detail

initialize

public void initialize(Object obj)
Specified by:
initialize in interface OnmsDao<T,K extends Serializable>

flush

public void flush()
Specified by:
flush in interface OnmsDao<T,K extends Serializable>

clear

public void clear()
Specified by:
clear in interface OnmsDao<T,K extends Serializable>

evict

public void evict(T entity)

merge

public void merge(T entity)

find

public List<T> find(String query)

find

public List<T> find(String query,
                    Object... values)

findObjects

public <S> List<S> findObjects(Class<S> clazz,
                               String query,
                               Object... values)

queryInt

protected int queryInt(String query)

queryInt

protected int queryInt(String queryString,
                       Object... args)

findUnique

protected T findUnique(String query)

findUnique

protected T findUnique(String queryString,
                       Object... args)

findUnique

protected <S> S findUnique(Class<? extends S> type,
                           String queryString,
                           Object... args)

countAll

public int countAll()
Specified by:
countAll in interface OnmsDao<T,K extends Serializable>

delete

public void delete(T entity)
            throws org.springframework.dao.DataAccessException
Specified by:
delete in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException

deleteAll

public void deleteAll(Collection<T> entities)
               throws org.springframework.dao.DataAccessException
Throws:
org.springframework.dao.DataAccessException

findAll

public List<T> findAll()
                throws org.springframework.dao.DataAccessException
Specified by:
findAll in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException

findMatchingObjects

public <S> List<S> findMatchingObjects(Class<S> type,
                                       OnmsCriteria onmsCrit)

findMatching

public List<T> findMatching(OnmsCriteria onmsCrit)
                     throws org.springframework.dao.DataAccessException
Specified by:
findMatching in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException

countMatching

public int countMatching(OnmsCriteria onmsCrit)
                  throws org.springframework.dao.DataAccessException
Specified by:
countMatching in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException

bulkDelete

public int bulkDelete(String hql,
                      Object[] values)
               throws org.springframework.dao.DataAccessException
Throws:
org.springframework.dao.DataAccessException

get

public T get(K id)
      throws org.springframework.dao.DataAccessException
Specified by:
get in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException

load

public T load(K id)
       throws org.springframework.dao.DataAccessException
Specified by:
load in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException

save

public void save(T entity)
          throws org.springframework.dao.DataAccessException
Specified by:
save in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException

saveOrUpdate

public void saveOrUpdate(T entity)
                  throws org.springframework.dao.DataAccessException
Specified by:
saveOrUpdate in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException

update

public void update(T entity)
            throws org.springframework.dao.DataAccessException
Specified by:
update in interface OnmsDao<T,K extends Serializable>
Throws:
org.springframework.dao.DataAccessException


Copyright © 2009. All Rights Reserved.