Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate one-to-many relationship insert  RSS feed

 
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: 17309
11
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!