public class InventoryDAOImpl extends Object implements InventoryDAO
Modifier and Type | Field and Description |
---|---|
private EntityManager |
em |
Constructor and Description |
---|
InventoryDAOImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addProduct(Product p) |
private void |
applyBounds(TypedQuery<?> query,
int offset,
int limit) |
void |
createCategory(Category category) |
void |
deleteCategory(Category category) |
void |
deleteProduct(Product product) |
void |
detachCategory(Category category) |
List<Category> |
findCategoryByName(String criteria,
int offset,
int limit) |
List<Product> |
findProductsByName(String criteria,
int offset,
int limit) |
Category |
getCategory(int id) |
Product |
getProduct(int id) |
void |
setEntityManager(EntityManager em) |
Product |
updateProduct(Product product) |
@Inject private EntityManager em
public void setEntityManager(EntityManager em)
public void createCategory(Category category)
createCategory
in interface InventoryDAO
public Category getCategory(int id)
getCategory
in interface InventoryDAO
public List<Category> findCategoryByName(String criteria, int offset, int limit)
findCategoryByName
in interface InventoryDAO
public void detachCategory(Category category)
detachCategory
in interface InventoryDAO
public void deleteCategory(Category category)
deleteCategory
in interface InventoryDAO
public void addProduct(Product p)
addProduct
in interface InventoryDAO
public Product getProduct(int id)
getProduct
in interface InventoryDAO
public Product updateProduct(Product product)
updateProduct
in interface InventoryDAO
public List<Product> findProductsByName(String criteria, int offset, int limit)
findProductsByName
in interface InventoryDAO
public void deleteProduct(Product product)
deleteProduct
in interface InventoryDAO
private void applyBounds(TypedQuery<?> query, int offset, int limit)
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.