[jboss-user] [JBoss Seam] - Re: How to add two entities home in the same page?
cja987
do-not-reply at jboss.com
Thu Mar 8 14:32:42 EST 2007
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#4026392
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026392
More information about the jboss-user
mailing list