@Test public void testGetDrugGroup() { Integer drugGroupId = 1; DrugGroup result = dao.getDrugGroup(drugGroupId); String name = result.getName(); assertEquals("TestDrugGroup1", name); Set<Drug> resDrugs = result.getDrugs(); Iterator<Drug> itr = resDrugs.iterator(); Drug drug3 = itr.next(); Integer drugId = 11; assertEquals(drug3.getId(), drugId); }
@Override public DrugGroup getDrugGroup(Integer drugGroupId) throws DAOException { return (DrugGroup) sessionFactory.getCurrentSession().get(DrugGroup.class, drugGroupId); }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup getDrugGroup(Integer drugGroupId) throws DAOException { return (DrugGroup) sessionFactory.getCurrentSession().get(DrugGroup.class, drugGroupId); } }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup getDrugGroup(Integer drugGroupId) throws DAOException { return (DrugGroup) sessionFactory.getCurrentSession().get(DrugGroup.class, drugGroupId); }  }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup getDrugGroup(Integer drugGroupId) throws DAOException { return (DrugGroup) sessionFactory.getCurrentSession().get(DrugGroup.class, drugGroupId); }  void setSessionFactory(SessionFactory sessionFactory); @Override DrugGroup saveDrugGroup(DrugGroup drugGroup); @Override void deleteDrugGroup(DrugGroup drugGroup); @Override DrugGroup getDrugGroup(Integer drugGroupId); @Override DrugGroup getDrugGroupByUuid(String uuid); @Override List<DrugGroup> getDrugGroupByName(String name); @Override List<DrugGroup> getAllDrugGroup(boolean includeRetired); @Override DrugGroup updateDrugGroup(DrugGroup drugGroup); }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup getDrugGroup(Integer drugGroupId) throws DAOException { return (DrugGroup) sessionFactory.getCurrentSession().get(DrugGroup.class, drugGroupId); }  void setSessionFactory(SessionFactory sessionFactory); @Override DrugGroup saveDrugGroup(DrugGroup drugGroup); @Override void deleteDrugGroup(DrugGroup drugGroup); @Override DrugGroup getDrugGroup(Integer drugGroupId); @Override DrugGroup getDrugGroupByUuid(String uuid); @Override List<DrugGroup> getDrugGroupByName(String name); @Override List<DrugGroup> getAllDrugGroup(boolean includeRetired); @Override DrugGroup updateDrugGroup(DrugGroup drugGroup);  }