Announcement Announcement Module
No announcement yet.
Pizza example extension Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pizza example extension

    Hi everyone.

    I'm new in Roo, and also in spring framework.. In these days I've tried the pizza tutorial and I've read some of spring framework reference 3.0. I've tryed to change controllers, views, etc etc. In this way I think that Roo make me understand in a easy way how sprng works.. (or i mistake?)

    I've tryed to make the pizza orders a bit complex.. for example create an order with more pizzas and each pizza with the own quantity.

    Pizza 1 x 5
    Pizza 2 x 3
    etc etc question is.. how to make this in Roo? I don't find a way (certainly because of my inexperience).. i don't know if it is possible make this in Roo, o if i have to change views and controller by hand..

    Thank you for any reply!


  • #2
    You'd add a new integer field for quantity to the PizzaOrder class. See for more info. Note you can do their either by editing and just entering a "private Integer quantity" or alternately using the "field number" command.


    • #3
      Pizza example extension

      Hi and thank you for your reply.

      Probably I have not explained well. When I create PizzaOrder entity with pizzas ManyToMany relation Roo create a pizza_order_pizza relation table. My idea is to put here the quantity field.. (or I mistake?)

      In this way I can make an order with different kind of pizzas each with their own quantity!

      For example:

      Name: Marco
      Addres: bla bla bla
      Delivery Date: 27/10/2010

      Margherita x 1
      FourSeason x 2
      SeaFruits x 5

      In the same way I would specify the quantity of each pizza topping..

      If I put the quantity field in PizzaOrder entity, the field is referred to the order and not for each pizza in the order.. In my opinion I need a way to put quantity field in pizza_orders_pizzas table!

      Thank you!
      Last edited by mserioli; Jun 1st, 2010, 09:24 AM.


      • #4
        Rather than use:
        A *..* B

        change to:

        A 1..* C *..1 B

        Then on your entity C you can have a field that you want.