Class ProductCatalogDAO
- java.lang.Object
-
- info.ejava.examples.ejb.cdisales.dao.ProductCatalogDAO
-
- All Implemented Interfaces:
ProductCatalog
@Named public class ProductCatalogDAO extends Object implements ProductCatalog
-
-
Field Summary
Fields Modifier and Type Field Description private EntityManager
em
-
Constructor Summary
Constructors Constructor Description ProductCatalogDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Product
addProduct(Product product)
List<Product>
getBuyerProducts(Member buyer, int offset, int limit)
List<Product>
getProductsForSale(Product template, int offset, int limit)
List<Product>
getSellerProducts(Member seller, int offset, int limit)
int
remove(Product product)
-
-
-
Field Detail
-
em
@Inject private EntityManager em
-
-
Method Detail
-
addProduct
public Product addProduct(Product product)
- Specified by:
addProduct
in interfaceProductCatalog
-
getProductsForSale
public List<Product> getProductsForSale(Product template, int offset, int limit)
- Specified by:
getProductsForSale
in interfaceProductCatalog
-
getBuyerProducts
public List<Product> getBuyerProducts(Member buyer, int offset, int limit)
- Specified by:
getBuyerProducts
in interfaceProductCatalog
-
getSellerProducts
public List<Product> getSellerProducts(Member seller, int offset, int limit)
- Specified by:
getSellerProducts
in interfaceProductCatalog
-
remove
public int remove(Product product)
- Specified by:
remove
in interfaceProductCatalog
-
-