Class InventoryMgmtEJB
- java.lang.Object
-
- ejava.examples.ejbwar.inventory.ejb.InventoryMgmtEJB
-
public class InventoryMgmtEJB extends Object
This class implements the core transactional business logic for the inventory management. It is implemented as a no interface @Stateless session bean and has JAX-RS and RMI facades that deal with technology- specific communications with remote clients.
-
-
Field Summary
Fields Modifier and Type Field Description private InventoryDAO
dao
private EntityManager
em
private static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description InventoryMgmtEJB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Product
addProduct(Product product, String categoryName)
Category
createOrGetCategory(String name)
void
deleteCategory(int id)
void
deleteProduct(Product product)
Categories
findCategoryByName(String name, int offset, int limit)
Returns a list of categories that match the name providedProducts
findProductByName(String name, int offset, int limit)
Category
getCategory(int id)
Product
getProduct(int id)
Product
updateProduct(Product product)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
dao
@Inject private InventoryDAO dao
-
em
@Inject private EntityManager em
-
-
Method Detail
-
findCategoryByName
public Categories findCategoryByName(String name, int offset, int limit)
Returns a list of categories that match the name provided- Parameters:
name
-- Returns:
-
getCategory
public Category getCategory(int id)
-
deleteCategory
public void deleteCategory(int id)
-
getProduct
public Product getProduct(int id)
-
deleteProduct
public void deleteProduct(Product product)
-
-