Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Avinash Rawana
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Avinash Rawana
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stupid mistake guys, I was saving from the Domain object end but the mapping file was missing cascade=all on that end.

:-D
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic