Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cascading problem

 
Alexander Curvers
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have trouble setting a relation so the related foreign key is set to null when parent is removed...

SO i have as entity products that have one image entity per product.. when an image is removed i get a constraint error when its in use by a product.. and i just want the product be updated/image_id foreign key set to null (by hibernate), tried serveral things but nothing worked, what i have now is:



 
Aurelian Tutuianu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a CascadeType.REMOVE at line 7
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic