Mar 1st, 2010, 09:07 AM
scaffolding a composition relationship
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 ?
Mar 2nd, 2010, 06:33 PM
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.
Tags for this Thread