This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Turn off cascade delete when using entity inheritance?

 
Theodore David Williams
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like when you implement table per subclass you get cascade delete as a default.

Is there any way you can turn this off. I.E. I want my DB to handle the cascade delete not hibernate.

Example:

Parent class
When I delete all item from the parent class I want and Entities that are inherited off of the parent to not be cascade deleted by hibernate


Child Class
Not much here other than when I do a batch delete on the parent I do not want hibernate to delete from this classes table


I tried using


On the parent entity but it looks like when I issue that delete hibernate is still trying to cascade delete on the children entities.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Tedd. I was hoping you could check your private messages for a little administrative matter? Thanks alot. It'll only take a second.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic