Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate 2:Update objects which has List

 
amit sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to persist object which has collection List .I have 2 tables .Everything is working fine but problem is that when i update the object then the original values does not delete but instead hibernate set the value of index column and foreign key null.I want that hibernate delete that row.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use cascade-option of "delete-orphan" in order for it to delete, if you use "delete" it just nulls out the Foreign Key.

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