예제 #1
0
 @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";
 }
예제 #2
0
 public String addressSelection(Address address) {
   order.setAddress(address);
   return "confirmOrder";
 }
예제 #3
0
 public String addPizzaToOrder() {
   order.getPizzas().remove(currentPizza);
   order.getPizzas().add(currentPizza);
   currentPizza = new Pizza(order);
   return "createOrder";
 }
예제 #4
0
 public void removeFromOrder(Pizza pizza) {
   order.getPizzas().remove(pizza);
 }