Package ejava.examples.blpurchase.blimpl
Class CatalogImpl
- java.lang.Object
-
- ejava.examples.blpurchase.blimpl.CatalogImpl
-
-
Field Summary
Fields Modifier and Type Field Description private EntityManager
em
private static org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description CatalogImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addToCart(int id, String email)
Adds the selected product to the users' shopping cart and returns the count of items.List<Product>
getProducts(int offset, int limit)
Returns a list of products in the catalog chunked into page sizes.void
setEntityManager(EntityManager entityManager)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
em
private EntityManager em
-
-
Method Detail
-
setEntityManager
public void setEntityManager(EntityManager entityManager)
-
getProducts
public List<Product> getProducts(int offset, int limit)
Description copied from interface:Catalog
Returns a list of products in the catalog chunked into page sizes.- Specified by:
getProducts
in interfaceCatalog
- Returns:
- list of products matching the paging criteria
-
-