Results 1 to 2 of 2

Thread: scaffolding a composition relationship

  1. #1
    Join Date
    Mar 2010
    Posts
    9

    Default scaffolding a composition relationship

    Hi,

    First, excuse my english.
    Let's say I have a 1:n composition relationship between an Order and OrderItems (order-items "belong to" the order, so they should be created and removed along with the order).
    On one hand, it's a bit clumsy to scaffold 2 controllers and then let the user struggle to wire all the stuff.
    On the other hand, it's quite painful to modify by hand the Order controller/view to embed the OrderItems CRUD logic.

    Is there any support for this in Roo ?
    Thanks

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    At the moment Roo scaffolds one Controller per domain object (although several controllers per domain object are also supported). To have one controller for several domain objects (like order and orderitem) can become very messy very fast although it may make sense in some situations. You can try to have both controllers generated and then merge them. Keep in mind that you will most likely also need to adjust your jspx artifacts accordingly.

    HTH,
    Stefan
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •