This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cascading problem

 
Alexander Curvers
Ranch Hand
Posts: 33
  • 0
  • 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
  • 0
  • 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