Package org.opennms.netmgt.dao.hibernate
Class AbstractCachingDaoHibernate<T,DbKey extends java.io.Serializable,CacheKey>
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate3.support.HibernateDaoSupport
-
- org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate<T,DbKey>
-
- org.opennms.netmgt.dao.hibernate.AbstractCachingDaoHibernate<T,DbKey,CacheKey>
-
- All Implemented Interfaces:
OnmsDao<T,DbKey>
,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
CategoryDaoHibernate
,ServiceTypeDaoHibernate
public abstract class AbstractCachingDaoHibernate<T,DbKey extends java.io.Serializable,CacheKey> extends AbstractDaoHibernate<T,DbKey>
AbstractCachingDaoHibernate- Version:
- $Id: $
- Author:
- brozow
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
m_criteriaConverter
-
-
Constructor Summary
Constructors Constructor Description AbstractCachingDaoHibernate(java.lang.Class<T> entityClass, boolean dbKeyMatchesCacheKey)
Constructor for AbstractCachingDaoHibernate.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
void
delete(T entity)
deletevoid
deleteAll(java.util.Collection<T> entities)
deleteAlljava.util.List<T>
findAll()
findAllprotected T
findByCacheKey(java.lang.String queryString, CacheKey key)
findByCacheKeyT
get(DbKey id)
getprotected abstract CacheKey
getKey(T t)
getKeyT
load(DbKey id)
loadvoid
merge(T entity)
DbKey
save(T entity)
savevoid
saveOrUpdate(T entity)
saveOrUpdatevoid
update(T entity)
update-
Methods inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
buildHibernateCallback, bulkDelete, countAll, countMatching, countMatching, delete, find, find, findMatching, findMatching, findObjects, findUnique, flush, initDao, initialize, lock, queryInt, queryInt
-
-
-
-
Constructor Detail
-
AbstractCachingDaoHibernate
public AbstractCachingDaoHibernate(java.lang.Class<T> entityClass, boolean dbKeyMatchesCacheKey)
Constructor for AbstractCachingDaoHibernate.
- Type Parameters:
T
- a T object.DbKey
- a DbKey object.CacheKey
- a CacheKey object.- Parameters:
entityClass
- aClass
object.dbKeyMatchesCacheKey
- a boolean.
-
-
Method Detail
-
getKey
protected abstract CacheKey getKey(T t)
getKey
- Parameters:
t
- a T object.- Returns:
- a CacheKey object.
-
clear
public void clear()
-
deleteAll
public void deleteAll(java.util.Collection<T> entities) throws org.springframework.dao.DataAccessException
deleteAll
- Overrides:
deleteAll
in classAbstractDaoHibernate<T,DbKey extends java.io.Serializable>
- Parameters:
entities
- aCollection
object.- Throws:
org.springframework.dao.DataAccessException
- if any.
-
delete
public void delete(T entity) throws org.springframework.dao.DataAccessException
delete
-
findAll
public java.util.List<T> findAll() throws org.springframework.dao.DataAccessException
findAll
-
merge
public void merge(T entity)
- Overrides:
merge
in classAbstractDaoHibernate<T,DbKey extends java.io.Serializable>
-
saveOrUpdate
public void saveOrUpdate(T entity) throws org.springframework.dao.DataAccessException
saveOrUpdate
- Specified by:
saveOrUpdate
in interfaceOnmsDao<T,DbKey extends java.io.Serializable>
- Overrides:
saveOrUpdate
in classAbstractDaoHibernate<T,DbKey extends java.io.Serializable>
- Parameters:
entity
- a T object.- Throws:
org.springframework.dao.DataAccessException
- if any.
-
update
public void update(T entity) throws org.springframework.dao.DataAccessException
update
-
-