• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting all,delete-orphans on Many-to-One relationship?  RSS feed

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
Why isnt it possible to cascade all,delete-orphan on many-to-one relationship?

Fr example,
Car and Driver
Driver can drive several cars, when deleting car and the driver is not driving any other car - remove the driver also



I get an error:



Any suggestion?
 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
https://forums.hibernate.org/viewtopic.php?f=1&t=939229&view=next
http://opensource.atlassian.com/projects/hibernate/browse/HB-1010

Gavin King:
Orphan delete for a many-to-one is anyway semantically incorrect! (A one-to-one might make sense.)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!