コード例 #1
0
  public ProductDTO getProductDetailById(Long id) {
    productDAO.setEm(em);
    Product product = em.find(Product.class, id);
    Top5 productTop5 = productDAO.getProductTop5(product.getId());

    ProductDTO productDTO = OMSMapper.mapProduct(product);
    if (productTop5 != null) {
      productDTO.setTop5(OMSMapper.mapTop5(productDAO.getTopProducts(productTop5)));
    }

    return productDTO;
  }
コード例 #2
0
  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;
  }