• 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!