File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes One-to-One Hibernate\Spring , Child not inserted Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "One-to-One Hibernate\Spring , Child not inserted" Watch "One-to-One Hibernate\Spring , Child not inserted" New topic
Author

One-to-One Hibernate\Spring , Child not inserted

Avinash Rawana
Ranch Hand

Joined: Feb 22, 2006
Posts: 31
Domain Mapping HBM :


Form Mapping HBM:






I have a one to one between Domain and Form. I want to create the Domain object using my controller in Spring. I created the Domain object then created a Form object, then did Domain.setForm on the new Form object. I then tried to save to the DB and only the parent is persisted, not the child.

-Avinash


--------------<br />Avinash A. Ramana<br />NYIT Student<br /><a href="http://www.aramana.org" target="_blank" rel="nofollow">http://www.aramana.org</a><br />avinash@styleempire.com
Avinash Rawana
Ranch Hand

Joined: Feb 22, 2006
Posts: 31
Stupid mistake guys, I was saving from the Domain object end but the mapping file was missing cascade=all on that end.

:-D
 
 
subject: One-to-One Hibernate\Spring , Child not inserted
 
Threads others viewed
list objects present in hibernate session
Hibernate generating queries with duplicate columns
Hibernate Issue
Child object is not saving.
one to many mapping
developer file tools