@Test @Transactional public void testSaveOnmsMap6() { OnmsMap map = new OnmsMap("onmsMapDaoHibernateTestMap6", "users","11aabb","admin",OnmsMap.ACCESS_MODE_GROUP, OnmsMap.AUTOMATICALLY_GENERATED_MAP,800,600); m_onmsMapDao.save(map); m_onmsMapDao.flush(); m_onmsMapDao.clear(); OnmsMap map2 = m_onmsMapDao.findMapById(map.getId()); map2.setType(OnmsMap.AUTOMATIC_SAVED_MAP); m_onmsMapDao.save(map2); m_onmsMapDao.flush(); m_onmsMapDao.clear(); OnmsMap map3 = m_onmsMapDao.findMapById(map.getId()); assertNotSame(map2, map3); assertEquals(map2.getName(), map3.getName()); assertEquals(map2.getOwner(), map3.getOwner()); assertEquals(map2.getType(), OnmsMap.AUTOMATIC_SAVED_MAP); assertEquals(map2.getAccessMode(), map3.getAccessMode().trim()); assertEquals(map2.getUserLastModifies(), map3.getUserLastModifies()); assertEquals(map2.getLastModifiedTime(), map3.getLastModifiedTime()); assertEquals(map2.getCreateTime(), map3.getCreateTime()); assertEquals(map2.getWidth(), map3.getWidth()); assertEquals(map2.getHeight(), map3.getHeight()); }
public OnmsMap findMapById(int id) { return findUnique("from OnmsMap as map where map.id = ?", id); }
OnmsMapDaoHibernate extends AbstractDaoHibernate<OnmsMap, Integer> implements OnmsMapDao { public OnmsMap findMapById(int id) { return findUnique("from OnmsMap as map where map.id = ?", id); } }
OnmsMapDaoHibernate extends AbstractDaoHibernate<OnmsMap, Integer> implements OnmsMapDao { public OnmsMap findMapById(int id) { return findUnique("from OnmsMap as map where map.id = ?", id); } OnmsMapDaoHibernate(); }
OnmsMapDaoHibernate extends AbstractDaoHibernate<OnmsMap, Integer> implements OnmsMapDao { public OnmsMap findMapById(int id) { return findUnique("from OnmsMap as map where map.id = ?", id); } OnmsMapDaoHibernate(); @SuppressWarnings("unchecked") Collection<OnmsMap> findAll(final Integer offset, final Integer limit); Collection<OnmsMap> findMapsLike(String mapLabel); Collection<OnmsMap> findMapsByName(String mapLabel); OnmsMap findMapById(int id); Collection<OnmsMap> findMapsByNameAndType(String mapName, String mapType); Collection<OnmsMap> findMapsByType(String mapType); Collection<OnmsMap> findAutoMaps(); Collection<OnmsMap> findUserMaps(); Collection<OnmsMap> findSaveMaps(); Collection<OnmsMap> findMapsByGroup(String group); Collection<OnmsMap> findMapsByOwner(String owner); Collection<OnmsMap> findVisibleMapsByGroup(String group); Collection<OnmsMap> findAutoAndSaveMaps(); int updateAllAutomatedMap(final Date time); }
OnmsMapDaoHibernate extends AbstractDaoHibernate<OnmsMap, Integer> implements OnmsMapDao { public OnmsMap findMapById(int id) { return findUnique("from OnmsMap as map where map.id = ?", id); } OnmsMapDaoHibernate(); @SuppressWarnings("unchecked") Collection<OnmsMap> findAll(final Integer offset, final Integer limit); Collection<OnmsMap> findMapsLike(String mapLabel); Collection<OnmsMap> findMapsByName(String mapLabel); OnmsMap findMapById(int id); Collection<OnmsMap> findMapsByNameAndType(String mapName, String mapType); Collection<OnmsMap> findMapsByType(String mapType); Collection<OnmsMap> findAutoMaps(); Collection<OnmsMap> findUserMaps(); Collection<OnmsMap> findSaveMaps(); Collection<OnmsMap> findMapsByGroup(String group); Collection<OnmsMap> findMapsByOwner(String owner); Collection<OnmsMap> findVisibleMapsByGroup(String group); Collection<OnmsMap> findAutoAndSaveMaps(); int updateAllAutomatedMap(final Date time);  }