@Test @Transactional public void testSaveOnmsMapElement1() { OnmsMap map = new OnmsMap("onmsMapDaoHibernateTestMap1", "admin"); m_onmsMapDao.save(map); m_onmsMapDao.flush(); m_onmsMapDao.clear(); OnmsMapElement mapElement = new OnmsMapElement(map, 2, OnmsMapElement.NODE_HIDE_TYPE, "Test Node Two", OnmsMapElement.defaultNodeIcon, 0, 10); m_onmsMapElementDao.save(mapElement); m_onmsMapElementDao.flush(); m_onmsMapElementDao.clear(); OnmsMapElement mapElement2 = m_onmsMapElementDao.findElementById(mapElement.getId()); assertNotSame(mapElement, mapElement2); assertEquals(mapElement.getMap().getId(), mapElement2.getMap().getId()); assertEquals(mapElement.getElementId(), mapElement2.getElementId()); assertEquals(mapElement.getType(), mapElement2.getType()); assertEquals(mapElement.getLabel(), mapElement2.getLabel()); assertEquals(mapElement.getIconName(), mapElement2.getIconName()); assertEquals(mapElement.getX(), mapElement2.getX()); assertEquals(mapElement.getY(), mapElement2.getY()); }
public OnmsMapElement findElementById(int id) { return findUnique("from OnmsMapElement as element where element.id = ?", id); }
OnmsMapElementDaoHibernate extends AbstractDaoHibernate<OnmsMapElement, Integer> implements OnmsMapElementDao { public OnmsMapElement findElementById(int id) { return findUnique("from OnmsMapElement as element where element.id = ?", id); } }
OnmsMapElementDaoHibernate extends AbstractDaoHibernate<OnmsMapElement, Integer> implements OnmsMapElementDao { public OnmsMapElement findElementById(int id) { return findUnique("from OnmsMapElement as element where element.id = ?", id); } OnmsMapElementDaoHibernate(); }
OnmsMapElementDaoHibernate extends AbstractDaoHibernate<OnmsMapElement, Integer> implements OnmsMapElementDao { public OnmsMapElement findElementById(int id) { return findUnique("from OnmsMapElement as element where element.id = ?", id); } OnmsMapElementDaoHibernate(); @SuppressWarnings("unchecked") Collection<OnmsMapElement> findAll(final Integer offset, final Integer limit); OnmsMapElement findElementById(int id); Collection<OnmsMapElement> findElementsByMapId(OnmsMap map); Collection<OnmsMapElement> findElementsByNodeId(int nodeid); void deleteElementsByMapId(final OnmsMap map); void deleteElementsByNodeid(final int nodeid); void deleteElementsByType(final String type); void deleteElementsByElementIdAndType(final int id,final String type); Collection<OnmsMapElement> findElementsByElementIdAndType(
            int elementId, String type); Collection<OnmsMapElement> findElementsByType(String type); OnmsMapElement findElement(int elementId, String type, OnmsMap map); void deleteElementsByMapType(final String mapType); Collection<OnmsMapElement> findElementsByMapIdAndType(int mapId,
            String type); Collection<OnmsMapElement> findMapElementsOnMap(int mapId); Collection<OnmsMapElement> findNodeElementsOnMap(int mapId); int countElementsOnMap(final int mapid); }
OnmsMapElementDaoHibernate extends AbstractDaoHibernate<OnmsMapElement, Integer> implements OnmsMapElementDao { public OnmsMapElement findElementById(int id) { return findUnique("from OnmsMapElement as element where element.id = ?", id); } OnmsMapElementDaoHibernate(); @SuppressWarnings("unchecked") Collection<OnmsMapElement> findAll(final Integer offset, final Integer limit); OnmsMapElement findElementById(int id); Collection<OnmsMapElement> findElementsByMapId(OnmsMap map); Collection<OnmsMapElement> findElementsByNodeId(int nodeid); void deleteElementsByMapId(final OnmsMap map); void deleteElementsByNodeid(final int nodeid); void deleteElementsByType(final String type); void deleteElementsByElementIdAndType(final int id,final String type); Collection<OnmsMapElement> findElementsByElementIdAndType(
            int elementId, String type); Collection<OnmsMapElement> findElementsByType(String type); OnmsMapElement findElement(int elementId, String type, OnmsMap map); void deleteElementsByMapType(final String mapType); Collection<OnmsMapElement> findElementsByMapIdAndType(int mapId,
            String type); Collection<OnmsMapElement> findMapElementsOnMap(int mapId); Collection<OnmsMapElement> findNodeElementsOnMap(int mapId); int countElementsOnMap(final int mapid);  }