/** * 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(); }