@Test public void testGetDrugPurchaseOrderByStockLocation() { List<DrugPurchaseOrder> result = dao.getDrugPurchaseOrderByStockLocation(1); assertEquals(1, result.size()); }
@Override public List<DrugPurchaseOrder> getDrugPurchaseOrderByStockLocation(Integer stockLocation) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("stockLocationId", stockLocation)); List<DrugPurchaseOrder> drugPurchaseOrders = new ArrayList<DrugPurchaseOrder>(); drugPurchaseOrders.addAll(criteria.list()); return drugPurchaseOrders; }
HibernateDrugPurchaseOrderDAO implements DrugPurchaseOrderDAO { @Override public List<DrugPurchaseOrder> getDrugPurchaseOrderByStockLocation(Integer stockLocation) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("stockLocationId", stockLocation)); List<DrugPurchaseOrder> drugPurchaseOrders = new ArrayList<DrugPurchaseOrder>(); drugPurchaseOrders.addAll(criteria.list()); return drugPurchaseOrders; } }
HibernateDrugPurchaseOrderDAO implements DrugPurchaseOrderDAO { @Override public List<DrugPurchaseOrder> getDrugPurchaseOrderByStockLocation(Integer stockLocation) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("stockLocationId", stockLocation)); List<DrugPurchaseOrder> drugPurchaseOrders = new ArrayList<DrugPurchaseOrder>(); drugPurchaseOrders.addAll(criteria.list()); return drugPurchaseOrders; }  }
HibernateDrugPurchaseOrderDAO implements DrugPurchaseOrderDAO { @Override public List<DrugPurchaseOrder> getDrugPurchaseOrderByStockLocation(Integer stockLocation) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("stockLocationId", stockLocation)); List<DrugPurchaseOrder> drugPurchaseOrders = new ArrayList<DrugPurchaseOrder>(); drugPurchaseOrders.addAll(criteria.list()); return drugPurchaseOrders; }  void setSessionFactory(SessionFactory sessionFactory); DrugPurchaseOrder saveDrugPurchaseOrder(DrugPurchaseOrder drugPurchaseOrder); DrugPurchaseOrder getDrugPurchaseOrderByUuid(String uuid); List<DrugPurchaseOrder> getAllDrugPurchaseOrders(); List<DrugPurchaseOrder> getAllDrugPurchaseOrdersNotReceived(); DrugPurchaseOrder updateDrugPurchaseOrder(DrugPurchaseOrder drugPurchaseOrder); void deleteDrugPurchaseOrder(DrugPurchaseOrder drugPurchaseOrder); List<DrugPurchaseOrder> getDrugPurchaseOrderByProvider(Integer providerId); @Override List<DrugPurchaseOrder> getDrugPurchaseOrderByDispenseLocation(Integer dispenseLocation); @Override List<DrugPurchaseOrder> getDrugPurchaseOrderByStockLocation(Integer stockLocation); }
HibernateDrugPurchaseOrderDAO implements DrugPurchaseOrderDAO { @Override public List<DrugPurchaseOrder> getDrugPurchaseOrderByStockLocation(Integer stockLocation) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("stockLocationId", stockLocation)); List<DrugPurchaseOrder> drugPurchaseOrders = new ArrayList<DrugPurchaseOrder>(); drugPurchaseOrders.addAll(criteria.list()); return drugPurchaseOrders; }  void setSessionFactory(SessionFactory sessionFactory); DrugPurchaseOrder saveDrugPurchaseOrder(DrugPurchaseOrder drugPurchaseOrder); DrugPurchaseOrder getDrugPurchaseOrderByUuid(String uuid); List<DrugPurchaseOrder> getAllDrugPurchaseOrders(); List<DrugPurchaseOrder> getAllDrugPurchaseOrdersNotReceived(); DrugPurchaseOrder updateDrugPurchaseOrder(DrugPurchaseOrder drugPurchaseOrder); void deleteDrugPurchaseOrder(DrugPurchaseOrder drugPurchaseOrder); List<DrugPurchaseOrder> getDrugPurchaseOrderByProvider(Integer providerId); @Override List<DrugPurchaseOrder> getDrugPurchaseOrderByDispenseLocation(Integer dispenseLocation); @Override List<DrugPurchaseOrder> getDrugPurchaseOrderByStockLocation(Integer stockLocation);  }