@Test public void testGetRaxaAlertByProviderRecipientId() { Integer providerRecipientId = 1; String result = dao.getRaxaAlertByProviderRecipientId(providerRecipientId, true).get(0).getName(); assertEquals("TestList1", result); }
@Override public List<RaxaAlert> getRaxaAlertByProviderRecipientId(Integer providerRecipientId, boolean includeSeen) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RaxaAlert.class); criteria.add(Restrictions.eq("providerRecipientId", providerRecipientId)); if (includeSeen == false) criteria.add(Restrictions.eq("seen", false)); List<RaxaAlert> alerts = new ArrayList<RaxaAlert>(); alerts.addAll(criteria.list()); return alerts; }
HibernateRaxaAlertDAO implements RaxaAlertDAO { @Override public List<RaxaAlert> getRaxaAlertByProviderRecipientId(Integer providerRecipientId, boolean includeSeen) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RaxaAlert.class); criteria.add(Restrictions.eq("providerRecipientId", providerRecipientId)); if (includeSeen == false) criteria.add(Restrictions.eq("seen", false)); List<RaxaAlert> alerts = new ArrayList<RaxaAlert>(); alerts.addAll(criteria.list()); return alerts; } }
HibernateRaxaAlertDAO implements RaxaAlertDAO { @Override public List<RaxaAlert> getRaxaAlertByProviderRecipientId(Integer providerRecipientId, boolean includeSeen) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RaxaAlert.class); criteria.add(Restrictions.eq("providerRecipientId", providerRecipientId)); if (includeSeen == false) criteria.add(Restrictions.eq("seen", false)); List<RaxaAlert> alerts = new ArrayList<RaxaAlert>(); alerts.addAll(criteria.list()); return alerts; }  }
HibernateRaxaAlertDAO implements RaxaAlertDAO { @Override public List<RaxaAlert> getRaxaAlertByProviderRecipientId(Integer providerRecipientId, boolean includeSeen) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RaxaAlert.class); criteria.add(Restrictions.eq("providerRecipientId", providerRecipientId)); if (includeSeen == false) criteria.add(Restrictions.eq("seen", false)); List<RaxaAlert> alerts = new ArrayList<RaxaAlert>(); alerts.addAll(criteria.list()); return alerts; }  void setSessionFactory(SessionFactory sessionFactory); @Override RaxaAlert saveRaxaAlert(RaxaAlert raxaAlert); @Override void deleteRaxaAlert(RaxaAlert raxaAlert); @Override RaxaAlert getRaxaAlert(Integer raxaAlertId); @Override RaxaAlert getRaxaAlertByUuid(String uuid); @Override List<RaxaAlert> getRaxaAlertByName(String name, boolean includeSeen); @Override List<RaxaAlert> getRaxaAlertByAlertType(String alertType, boolean includeSeen); @Override List<RaxaAlert> getRaxaAlertByPatientId(Integer patientId, boolean includeSeen); @Override List<RaxaAlert> getRaxaAlertByProviderSentId(Integer providerSentId, boolean includeSeen); @Override List<RaxaAlert> getRaxaAlertByProviderRecipientId(Integer providerRecipientId, boolean includeSeen); @Override List<RaxaAlert> getAllRaxaAlerts(boolean includeSeen); @Override RaxaAlert updateRaxaAlert(RaxaAlert raxaAlert); @Override RaxaAlert markRaxaAlertAsSeen(RaxaAlert raxaAlert); @Override RaxaAlert voidRaxaAlert(RaxaAlert raxaAlert, String reason); @Override List<RaxaAlert> getRaxaAlertByToLocationId(Integer id, boolean includeSeen); }
HibernateRaxaAlertDAO implements RaxaAlertDAO { @Override public List<RaxaAlert> getRaxaAlertByProviderRecipientId(Integer providerRecipientId, boolean includeSeen) throws DAOException { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(RaxaAlert.class); criteria.add(Restrictions.eq("providerRecipientId", providerRecipientId)); if (includeSeen == false) criteria.add(Restrictions.eq("seen", false)); List<RaxaAlert> alerts = new ArrayList<RaxaAlert>(); alerts.addAll(criteria.list()); return alerts; }  void setSessionFactory(SessionFactory sessionFactory); @Override RaxaAlert saveRaxaAlert(RaxaAlert raxaAlert); @Override void deleteRaxaAlert(RaxaAlert raxaAlert); @Override RaxaAlert getRaxaAlert(Integer raxaAlertId); @Override RaxaAlert getRaxaAlertByUuid(String uuid); @Override List<RaxaAlert> getRaxaAlertByName(String name, boolean includeSeen); @Override List<RaxaAlert> getRaxaAlertByAlertType(String alertType, boolean includeSeen); @Override List<RaxaAlert> getRaxaAlertByPatientId(Integer patientId, boolean includeSeen); @Override List<RaxaAlert> getRaxaAlertByProviderSentId(Integer providerSentId, boolean includeSeen); @Override List<RaxaAlert> getRaxaAlertByProviderRecipientId(Integer providerRecipientId, boolean includeSeen); @Override List<RaxaAlert> getAllRaxaAlerts(boolean includeSeen); @Override RaxaAlert updateRaxaAlert(RaxaAlert raxaAlert); @Override RaxaAlert markRaxaAlertAsSeen(RaxaAlert raxaAlert); @Override RaxaAlert voidRaxaAlert(RaxaAlert raxaAlert, String reason); @Override List<RaxaAlert> getRaxaAlertByToLocationId(Integer id, boolean includeSeen);  }