• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help require on parent -child cascade ralationship in hibernate

 
Tusshar Fasate
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to write hbm xml for parent and child class.
My requirement is when any parent record get deleted then corresponding all records in child table should be deleted.
how can I do this in hibernate.
Explanation is expected with examples.
Please help me on this.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the cascade attribute of the various association mappings Hibernate supports. See this.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!