@Test public void testGetAllPatientList_shouldReturnUnretiredPatientList() { List<PatientList> allPatientList = dao.getAllPatientList(false); assertEquals(allPatientList.size(), 2); }
@Override public List<PatientList> getAllPatientList(boolean includeRetired) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientList.class); if (includeRetired == false) { criteria.add(Restrictions.eq("retired", false)); } return criteria.list(); }
HibernatePatientListDAO implements PatientListDAO { @Override public List<PatientList> getAllPatientList(boolean includeRetired) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientList.class); if (includeRetired == false) { criteria.add(Restrictions.eq("retired", false)); } return criteria.list(); } }
HibernatePatientListDAO implements PatientListDAO { @Override public List<PatientList> getAllPatientList(boolean includeRetired) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientList.class); if (includeRetired == false) { criteria.add(Restrictions.eq("retired", false)); } return criteria.list(); }  }
HibernatePatientListDAO implements PatientListDAO { @Override public List<PatientList> getAllPatientList(boolean includeRetired) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientList.class); if (includeRetired == false) { criteria.add(Restrictions.eq("retired", false)); } return criteria.list(); }  void setSessionFactory(SessionFactory sessionFactory); @Override PatientList savePatientList(PatientList patientList); @Override void deletePatientList(PatientList patientList); @Override PatientList getPatientList(Integer patientListId); @Override List<PatientList> getPatientListByEncounterType(EncounterType encounterType); @Override PatientList getPatientListByUuid(String uuid); @Override List<PatientList> getPatientListByName(String name); @Override List<PatientList> getAllPatientList(boolean includeRetired); @Override PatientList updatePatientList(PatientList patientList); }
HibernatePatientListDAO implements PatientListDAO { @Override public List<PatientList> getAllPatientList(boolean includeRetired) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(PatientList.class); if (includeRetired == false) { criteria.add(Restrictions.eq("retired", false)); } return criteria.list(); }  void setSessionFactory(SessionFactory sessionFactory); @Override PatientList savePatientList(PatientList patientList); @Override void deletePatientList(PatientList patientList); @Override PatientList getPatientList(Integer patientListId); @Override List<PatientList> getPatientListByEncounterType(EncounterType encounterType); @Override PatientList getPatientListByUuid(String uuid); @Override List<PatientList> getPatientListByName(String name); @Override List<PatientList> getAllPatientList(boolean includeRetired); @Override PatientList updatePatientList(PatientList patientList);  }