Ejemplo n.º 1
0
 /**
  * Returns the price of the product with the given product ID.
  *
  * @param productId the product ID
  * @return the product's price
  */
 @Transactional(readOnly = true)
 public double getPrice(String productId) {
   Product product = storeDAO.getProduct(productId);
   return product.getPrice();
 }
Ejemplo n.º 2
0
 /**
  * Returns the number of items in stock of the product with the given product ID.
  *
  * @param productId the product ID
  * @return number of items
  */
 @Transactional(readOnly = true)
 public long getInventory(String productId) {
   Product product = storeDAO.getProduct(productId);
   return product.getInventory();
 }