This content has been marked as final.
Show 1 reply
-
1. Re: Lazy Initialization
bill.burke Feb 22, 2005 10:06 AM (in response to ffray)There is no CMR in EJB 3.0. There is one "managing" side of the relationship. In ManyToMany this is defined by the mappedBy attribute. For OneToMany the owner is alwasy the ManyToOne side.
So, for adding a topic, you'll have to do topic.setSeminar(this) within your "addTopic" method.
To update the collection, you'll have to merge the seminar and the OneToMany will have to have a CASCADE MERGE, or just merge every topic you add to the seminar.