Package org.opennms.netmgt.dao.hibernate
Class AcknowledgmentDaoHibernate
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate3.support.HibernateDaoSupport
-
- org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate<OnmsAcknowledgment,java.lang.Integer>
-
- org.opennms.netmgt.dao.hibernate.AcknowledgmentDaoHibernate
-
- All Implemented Interfaces:
AcknowledgmentDao
,OnmsDao<OnmsAcknowledgment,java.lang.Integer>
,org.springframework.beans.factory.InitializingBean
public class AcknowledgmentDaoHibernate extends AbstractDaoHibernate<OnmsAcknowledgment,java.lang.Integer> implements AcknowledgmentDao
Hibernate implementation of Acknowledgment DAO- Version:
- $Id: $
- Author:
- David Hustace
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
m_criteriaConverter
-
-
Constructor Summary
Constructors Constructor Description AcknowledgmentDaoHibernate()
Constructor for AcknowledgmentDaoHibernate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Acknowledgeable>
findAcknowledgables(OnmsAcknowledgment ack)
findAcknowledgablesjava.util.Optional<OnmsAcknowledgment>
findLatestAckForRefId(java.lang.Integer refId)
findLatestAckForRefIdjava.util.List<OnmsAcknowledgment>
findLatestAcks(java.util.Date from)
findLatestAcksvoid
processAck(OnmsAcknowledgment ack)
processAckvoid
processAcks(java.util.Collection<OnmsAcknowledgment> acks)
processAcksvoid
updateAckable(Acknowledgeable ackable)
updateAckable-
Methods inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
buildHibernateCallback, bulkDelete, clear, countAll, countMatching, countMatching, delete, delete, deleteAll, find, find, findAll, findMatching, findMatching, findObjects, findUnique, flush, get, initDao, initialize, load, lock, merge, queryInt, queryInt, save, saveOrUpdate, update
-
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.dao.api.OnmsDao
clear, countAll, countMatching, delete, delete, findAll, findMatching, flush, get, initialize, load, lock, save, saveOrUpdate, update
-
-
-
-
Method Detail
-
updateAckable
public void updateAckable(Acknowledgeable ackable)
updateAckable
- Specified by:
updateAckable
in interfaceAcknowledgmentDao
- Parameters:
ackable
- aAcknowledgeable
object.
-
findAcknowledgables
public java.util.List<Acknowledgeable> findAcknowledgables(OnmsAcknowledgment ack)
findAcknowledgables
- Specified by:
findAcknowledgables
in interfaceAcknowledgmentDao
- Parameters:
ack
- aOnmsAcknowledgment
object.- Returns:
- a
List
object.
-
processAcks
@Transactional(readOnly=false) public void processAcks(java.util.Collection<OnmsAcknowledgment> acks)
processAcks
- Specified by:
processAcks
in interfaceAcknowledgmentDao
- Parameters:
acks
- aCollection
object.
-
processAck
@Transactional(readOnly=false) public void processAck(OnmsAcknowledgment ack)
processAck
- Specified by:
processAck
in interfaceAcknowledgmentDao
- Parameters:
ack
- aOnmsAcknowledgment
object.
-
findLatestAcks
@Transactional public java.util.List<OnmsAcknowledgment> findLatestAcks(java.util.Date from)
Description copied from interface:AcknowledgmentDao
findLatestAcks
Finds the latest acknowledgement for each refId. The latest acknowledgement is selected based on the most recent ackTime (and highest Id in the case of multiple occuring at the same time).- Specified by:
findLatestAcks
in interfaceAcknowledgmentDao
- Parameters:
from
- limit results to acks created on or after- Returns:
- the list of latest acks (empty list in the case of no acks found)
-
findLatestAckForRefId
@Transactional public java.util.Optional<OnmsAcknowledgment> findLatestAckForRefId(java.lang.Integer refId)
Description copied from interface:AcknowledgmentDao
findLatestAckForRefId
Finds the latest acknowledgement for the given refId. The latest acknowledgement is selected based on the most recent ackTime (and highest Id in the case of multiple occurring at the same time).- Specified by:
findLatestAckForRefId
in interfaceAcknowledgmentDao
- Parameters:
refId
- the refId to search for- Returns:
- an optional containing the latest ack for the given refId or Optional.empty() if none found
-
-