@Test public void testGetDrugGroupByUuid() { String uuid = "68547121-1b70-465e-99ee-c9dfd95e7d30"; String result = dao.getDrugGroupByUuid(uuid).getName(); assertEquals("TestDrugGroup2", result); }
@Override public DrugGroup getDrugGroupByUuid(String uuid) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugGroup.class); criteria.add(Restrictions.eq("uuid", uuid)); return (DrugGroup) criteria.uniqueResult(); }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup getDrugGroupByUuid(String uuid) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugGroup.class); criteria.add(Restrictions.eq("uuid", uuid)); return (DrugGroup) criteria.uniqueResult(); } }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup getDrugGroupByUuid(String uuid) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugGroup.class); criteria.add(Restrictions.eq("uuid", uuid)); return (DrugGroup) criteria.uniqueResult(); }  }
HibernateDrugGroupDAO implements DrugGroupDAO { @Override public DrugGroup getDrugGroupByUuid(String uuid) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugGroup.class); criteria.add(Restrictions.eq("uuid", uuid)); return (DrugGroup) criteria.uniqueResult(); }  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 getDrugGroupByUuid(String uuid) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugGroup.class); criteria.add(Restrictions.eq("uuid", uuid)); return (DrugGroup) criteria.uniqueResult(); }  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);  }