public Collection getProducts(String catID) { return em.createQuery("SELECT p FROM Product p WHERE p.categoryID LIKE :categoryID") .setParameter("categoryID", catID) .getResultList(); }
public Collection getItems(String prodID) { return em.createQuery("SELECT i FROM Item i WHERE i.productID LIKE :productID") .setParameter("productID", prodID) .getResultList(); }
public Collection getCategories() { return em.createQuery("SELECT OBJECT(c) FROM Category_1 c").getResultList(); }