Exemplo n.º 1
0
  /* (non-Javadoc)
   * @see service.ProductService#updateProduct(VO.ProductVo)
   */
  @Override
  public void updateProduct(ProductVo productVo) {

    logger.info("start...");

    Product product = productDao.get(Product.class, productVo.getId());

    product.setName(productVo.getName());
    product.setDescription(productVo.getDescription());
    product.setImgURL(productVo.getImgURL());

    productDao.update(product);

    logger.info("end...");
  }
Exemplo n.º 2
0
  /* (non-Javadoc)
   * @see service.ProductService#getProduct(VO.ProductVo)
   */
  @Override
  public JSONObject getProduct(ProductVo productVo) {

    logger.info("start...");

    Product product = productDao.get(Product.class, productVo.getId());

    JSONObject object = new JSONObject();

    object.put("productId", product.getId());
    object.put("name", product.getName());
    object.put("description", product.getDescription());
    object.put("imgURL", product.getImgURL());

    logger.info("end...");

    return object;
  }
Exemplo n.º 3
0
  /* (non-Javadoc)
   * @see service.ProductService#deleteProduct(VO.ProductVo)
   */
  @Override
  public void deleteProduct(ProductVo productVo) {

    Product product = productDao.get(Product.class, productVo.getId());
    productDao.delete(product);
  }