@Test public void testSaveDrugGroup() { DrugGroup drugGroup = new DrugGroup(); drugGroup.setName("TestDrugGroup3"); drugGroup.setDescription("Third Test Drug Group"); drugGroup.setCreator(Context.getUserContext().getAuthenticatedUser()); drugGroup.setDateCreated(new java.util.Date()); drugGroup.setUuid("68547121-1b70-465c-99ee-c9dfd95e7d30"); drugGroup.setRetired(Boolean.FALSE); dao.saveDrugGroup(drugGroup); List<DrugGroup> result = dao.getDrugGroupByName("TestDrugGroup3"); String name = result.get(0).getName(); assertEquals(name, "TestDrugGroup3"); }
@Override public DrugGroup saveDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().saveOrUpdate(drugGroup); return drugGroup; }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup saveDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().saveOrUpdate(drugGroup); return drugGroup; } }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup saveDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().saveOrUpdate(drugGroup); return drugGroup; }  }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup saveDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().saveOrUpdate(drugGroup); return drugGroup; }  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 saveDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().saveOrUpdate(drugGroup); return drugGroup; }  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);  }