• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate one-to-many relationship insert

 
Nischal Tanna
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a 1-to-many relationship btw Parent and child class....In the parent class i am something like


While inserting records in the db, my code is:



The above code inserts successfully in the parent db but does not insert in the child table

Any ideas?....I have tried "inverse=true" as well...Do i need to define a Many-to-one in child as well?
[ July 16, 2007: Message edited by: Nischal Tanna ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are your cascade options set to for this relationship? you will probably want it set to "save-update".

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic