This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Cascading problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Cascading problem" Watch "Cascading problem" New topic
Author

Cascading problem

Alexander Curvers
Ranch Hand

Joined: Apr 03, 2009
Posts: 33
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

Joined: May 13, 2004
Posts: 86
Add a CascadeType.REMOVE at line 7


http://javasign.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cascading problem
 
It's not a secret anymore!