dhalliyur wrote:
I recently worked on this. I was able to save parent child.
Please post your hbm configuration file. and also you need to have inverse=true in the parent cfg.
There isn't a hbm config file - this is using the EJB3 system under JBoss. My example in this topic pretty much included all of the relevant content. Note that mappedBy is the equivalent of inverse="true".
However, if you want to see the real deal, here is the Parent object:
http://subetha.tigris.org/source/browse ... cvs-markup
Here is the child object:
http://subetha.tigris.org/source/browse ... cvs-markup
There are three relationships:
ManyToOne from Role to MailingList
OneToMany from MailingList to Role (being mappedBy, this is the equivalent of "inverse")
OneToOne from MailingList to Role (the default role)
Both the ManyToOne and OneToOne relationships are nullable=false.
The constructor of MailingList (the parent) must create, and include for persistence, a single default role.
Thanks,
Jeff Schnitzer