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 InventoryDAOdaoprivate EntityManageremprivate static org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description InventoryMgmtEJB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProductaddProduct(Product product, String categoryName)CategorycreateOrGetCategory(String name)voiddeleteCategory(int id)voiddeleteProduct(Product product)CategoriesfindCategoryByName(String name, int offset, int limit)Returns a list of categories that match the name providedProductsfindProductByName(String name, int offset, int limit)CategorygetCategory(int id)ProductgetProduct(int id)ProductupdateProduct(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)
-
-