Exemplo n.º 1
0
  public String removeCheese() {
    Cheese tempCheese = new Cheese(getSelectedCheeseName(), "");
    Cheese storedCheese = service.find(tempCheese);
    if (storedCheese == null) {
      FacesContext.getCurrentInstance()
          .addMessage(null, new FacesMessage("Cheese " + tempCheese.getName() + "  Not Found!"));
      return "delete error";
    }

    service.remove(storedCheese);
    FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Cheese Removed"));
    return "ok";
  }
Exemplo n.º 2
0
 public List getCheeses() {
   if (cheeses == null) {
     cheeses = new ArrayList(service.getCheeses());
   }
   return cheeses;
 }