예제 #1
0
 /**
  * Retrieve a book
  *
  * @param long price of the items to be retrieved
  * @return Stockitem stockitem represented by the price provided
  */
 public Stockitem getItemByPrice(long price) {
   return stockitemDAO.findByPrice(BigDecimal.valueOf(price));
 }
예제 #2
0
 /**
  * Retrieve a book
  *
  * @param int id identifier of the item to be retrieved
  * @return Book book represented by the identifier provided
  */
 public Stockitem getItemById(int id) {
   return (Stockitem) stockitemDAO.findByID(Stockitem.class, BigDecimal.valueOf(id));
 }
예제 #3
0
 /**
  * Delete item from data store
  *
  * @param Stockitem stockitem
  */
 public void deleteItem(Stockitem stockitem) {
   stockitemDAO.delete(stockitem);
 }
예제 #4
0
 /**
  * Find all items in database
  *
  * @return ArrayList<Stockitem> of items
  */
 public List<Stockitem> getItem() {
   return (ArrayList<Stockitem>) stockitemDAO.findAllStockitem();
 }
예제 #5
0
 /**
  * Create a new item or update an existing one
  *
  * @param Stockitem stockitem
  */
 public void createOrUpdateItem(Stockitem stockitem) {
   stockitemDAO.save(stockitem);
 }