@Test public void testDeleteDrugGroup() { DrugGroup drugGroup = new DrugGroup(); drugGroup.setId(2); drugGroup.setName("TestDrugGroup2"); drugGroup.setDescription("Second Test Drug Group"); drugGroup.setCreator(Context.getUserContext().getAuthenticatedUser()); drugGroup.setDateCreated(new java.util.Date()); drugGroup.setUuid("68547121-1b70-465e-99ee-c9dfd95e7d30"); drugGroup.setRetired(Boolean.FALSE); Set<Drug> drugs = new HashSet<Drug>(); Drug drug1 = new Drug(); Drug drug2 = new Drug(); drug1.setId(1); drug1.setConcept(new Concept(792)); drug1.setDateCreated(new Date()); drug1.setCreator(Context.getUserContext().getAuthenticatedUser()); drug2.setId(2); drug2.setConcept(new Concept(792)); drug2.setDateCreated(new Date()); drug2.setCreator(Context.getUserContext().getAuthenticatedUser()); drugs.add(drug1); drugs.add(drug2); drugGroup.setDrugs(drugs); dao.deleteDrugGroup(drugGroup); DrugGroup result = dao.getDrugGroup(2); assertEquals(null, result); }
@Override public void deleteDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().delete(drugGroup); }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public void deleteDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().delete(drugGroup); } }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public void deleteDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().delete(drugGroup); }  }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public void deleteDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().delete(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 void deleteDrugGroup(DrugGroup drugGroup) throws DAOException { sessionFactory.getCurrentSession().delete(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);  }