@End public String confirmOrder() { order.setCreationDate(new Date()); for (Pizza pizza : order.getPizzas()) em.persist(pizza); em.persist(order); log.infov( "Order {0} placed by {1} with {2} pizzas", order.getId(), user.getUsername(), order.getPizzas().size()); return "completed"; }
public String addressSelection(Address address) { order.setAddress(address); return "confirmOrder"; }
public String addPizzaToOrder() { order.getPizzas().remove(currentPizza); order.getPizzas().add(currentPizza); currentPizza = new Pizza(order); return "createOrder"; }
public void removeFromOrder(Pizza pizza) { order.getPizzas().remove(pizza); }