You could make personHome inject the current phone, then have personHome.persist() call
getInstance().phones.add(phone)
However, that wires the policy a little too low level for my tastes. I personally
recommend an EditPersonAction (or whatever you want to call it) to back your edit page
that has personHome and phoneHome instances, and has a .save() action method that manages
the relationship there, rather than wiring controller-specific actions into the data
access layer.
(I do break this rule in one place, and that's when injecting an "author"
field into new instances, because the user identity is always in scope anyway, and I
don't want anything escaping that policy)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026392#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...