This content has been marked as final.
Show 4 replies
-
1. Re: Silly question - persisting child objects
nicolas.bielza Feb 5, 2009 8:13 PM (in response to hardaur)Are you calling setContest() on the prizes when you create them ?
-
2. Re: Silly question - persisting child objects
hardaur Feb 5, 2009 8:25 PM (in response to hardaur)That was it, thanks for your reply.
It seems like it should be assumed by Seam that children of a one to many relationship belong to the parent and should be persisted in that way. If that makes sense.
Thanks again!
Gerald
-
3. Re: Silly question - persisting child objects
binnyg Feb 6, 2009 12:47 AM (in response to hardaur)I usually do it in addXXX methods.
In your Contest class you can add a transient method like the following@Transient public void addPrize(Prize prize) { prize.setContext(this); this.prizes.add(prize); }
-
4. Re: Silly question - persisting child objects
hardaur Feb 6, 2009 1:32 PM (in response to hardaur)Binesh,
Excellent suggestion, thanks!
Gerald