Package org.opennms.netmgt.dao.hibernate
Class HwEntityDaoHibernate
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate3.support.HibernateDaoSupport
-
- org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate<OnmsHwEntity,Integer>
-
- org.opennms.netmgt.dao.hibernate.HwEntityDaoHibernate
-
- All Implemented Interfaces:
HwEntityDao
,OnmsDao<OnmsHwEntity,Integer>
,org.springframework.beans.factory.InitializingBean
public class HwEntityDaoHibernate extends AbstractDaoHibernate<OnmsHwEntity,Integer> implements HwEntityDao
The Class HwEntityDaoHibernate.- Author:
- Alejandro Galue
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
m_criteriaConverter
-
-
Constructor Summary
Constructors Constructor Description HwEntityDaoHibernate()
The Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OnmsHwEntity
findEntityByIndex(Integer nodeId, Integer entPhysicalIndex)
Find entity by index.OnmsHwEntity
findEntityByName(Integer nodeId, String entPhysicalName)
Find entity by name.OnmsHwEntity
findRootByNodeId(Integer nodeId)
Find root by node id.OnmsHwEntity
findRootEntityByNodeId(Integer nodeId)
Better performant than #findRootByNodeId.String
getAttributeValue(Integer nodeId, Integer entPhysicalIndex, String attributeName)
Gets the attribute value.String
getAttributeValue(Integer nodeId, String nameSource, String attributeName)
Gets the attribute value.-
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
-
findRootByNodeId
public OnmsHwEntity findRootByNodeId(Integer nodeId)
Description copied from interface:HwEntityDao
Find root by node id.- Specified by:
findRootByNodeId
in interfaceHwEntityDao
- Parameters:
nodeId
- the node id- Returns:
- the OpenNMS hardware entity
-
findRootEntityByNodeId
public OnmsHwEntity findRootEntityByNodeId(Integer nodeId)
Description copied from interface:HwEntityDao
Better performant than #findRootByNodeId. Useful when dealing with large trees. See NMS-13256 Find root by node id- Specified by:
findRootEntityByNodeId
in interfaceHwEntityDao
- Parameters:
nodeId
- the node id- Returns:
- the OpenNMS hardware entity
-
findEntityByIndex
public OnmsHwEntity findEntityByIndex(Integer nodeId, Integer entPhysicalIndex)
Description copied from interface:HwEntityDao
Find entity by index.- Specified by:
findEntityByIndex
in interfaceHwEntityDao
- Parameters:
nodeId
- the node identPhysicalIndex
- the entity physical index- Returns:
- the OpenNMS hardware entity
-
findEntityByName
public OnmsHwEntity findEntityByName(Integer nodeId, String entPhysicalName)
Description copied from interface:HwEntityDao
Find entity by name.- Specified by:
findEntityByName
in interfaceHwEntityDao
- Parameters:
nodeId
- the node identPhysicalName
- the entity physical name- Returns:
- the OpenNMS hardware entity
-
getAttributeValue
public String getAttributeValue(Integer nodeId, Integer entPhysicalIndex, String attributeName)
Description copied from interface:HwEntityDao
Gets the attribute value.- Specified by:
getAttributeValue
in interfaceHwEntityDao
- Parameters:
nodeId
- the node identPhysicalIndex
- the entity physical indexattributeName
- the name of the desired attribute- Returns:
- the attribute value
-
getAttributeValue
public String getAttributeValue(Integer nodeId, String nameSource, String attributeName)
Description copied from interface:HwEntityDao
Gets the attribute value.- Specified by:
getAttributeValue
in interfaceHwEntityDao
- Parameters:
nodeId
- the node idnameSource
- either the value of entPhysicalName or a regular expression to be applied over the entPhysicalName (should start with '~')attributeName
- the name of the desired attribute- Returns:
- the attribute value
-
-