public ProductDTO getProductDetail(Long prodId) { productDAO.setEm(em); Product product = productDAO.getProduct(prodId); Top5 productTop5 = productDAO.getProductTop5(product.getId()); ProductDTO productDTO = OMSMapper.mapProduct(product); if (productTop5 != null) { productDTO.setTop5(OMSMapper.mapTop5(productDAO.getTopProducts(productTop5))); } return productDTO; }
public Product getProduct(Long prodId) { productDAO.setEm(em); Product product = productDAO.getProduct(prodId); return product; }