wood burning stoves*
The moose likes Object Relational Mapping and the fly likes delete-orphan with hibernate annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "delete-orphan with hibernate annotation" Watch "delete-orphan with hibernate annotation" New topic
Author

delete-orphan with hibernate annotation

Anand Loni
Ranch Hand

Joined: Jan 20, 2006
Posts: 150
Hello,

I am using hibernate annotation (hibernate 3.2.5). I am not able to delete orphan objects using @Cascade( { CascadeType.DELETE_ORPHAN }). When I googled for this, I found that delete-orphan not supported for the version I am using. Even I tried with version 3.5.0. Any idea how to delete orphans ?

Thanks,


~ Anand,
SCJP 1.5, SCWCD 1.5
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Not sure I understand the question. Are you saying this annotation doesn't work with a version of Hibernate that claims to support it, or are you asking how to get this functionality in an earlier version?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Anand Loni
Ranch Hand

Joined: Jan 20, 2006
Posts: 150
Hi Paul,

Yes you are right. I want to delete orphan objects with the current version. Any ways to do this ?

Thanks
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Should be possible. Can we see your code?
Anand Loni
Ranch Hand

Joined: Jan 20, 2006
Posts: 150
Here is the code



When I update CandidateEnrollment with new details, old details are unassociated but not deleted.

Thank,

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: delete-orphan with hibernate annotation
 
Similar Threads
Hibernate annotations and JPA
Delete orphan object problem
quick hibernate question
hibernate association delete
Why a select statement, not an insert ?