@Test public void testGetDrugPurchaseOrderByUuid() { DrugPurchaseOrder result = dao.getDrugPurchaseOrderByUuid("68547121-1b70-465c-99ee-c9dfd95e7d31"); String name = result.getName(); assertEquals(name, "Test drug PO"); }
public DrugPurchaseOrder getDrugPurchaseOrderByUuid(String uuid) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("uuid", uuid)); System.out.println(criteria.uniqueResult()); return (DrugPurchaseOrder) criteria.uniqueResult(); }
HibernateDrugPurchaseOrderDAO implements DrugPurchaseOrderDAO { public DrugPurchaseOrder getDrugPurchaseOrderByUuid(String uuid) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("uuid", uuid)); System.out.println(criteria.uniqueResult()); return (DrugPurchaseOrder) criteria.uniqueResult(); } }
HibernateDrugPurchaseOrderDAO implements DrugPurchaseOrderDAO { public DrugPurchaseOrder getDrugPurchaseOrderByUuid(String uuid) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("uuid", uuid)); System.out.println(criteria.uniqueResult()); return (DrugPurchaseOrder) criteria.uniqueResult(); }  }
HibernateDrugPurchaseOrderDAO implements DrugPurchaseOrderDAO { public DrugPurchaseOrder getDrugPurchaseOrderByUuid(String uuid) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("uuid", uuid)); System.out.println(criteria.uniqueResult()); return (DrugPurchaseOrder) criteria.uniqueResult(); }  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 { public DrugPurchaseOrder getDrugPurchaseOrderByUuid(String uuid) { Criteria criteria = sessionFactory.getCurrentSession().createCriteria(DrugPurchaseOrder.class); criteria.add(Restrictions.eq("uuid", uuid)); System.out.println(criteria.uniqueResult()); return (DrugPurchaseOrder) criteria.uniqueResult(); }  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);  }