-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Inheritage and DELETE_ORPHAN
PostPosted: Tue Sep 15, 2009 12:10 pm 
Newbie

Joined: Fri Feb 27, 2009 7:01 am
Posts: 5
Hy all

I was wondering if anybody could brief me on the limitation of the DELETE_ORPHAN annotation in regards of inheritance.

In short, I've got a super class A with a oneToMany relationship to a class B (which has a bidirectional relationship back to A). The A to B relationship has the following annotations:

Code:
   
    @OneToMany(mappedBy = "myA", cascade = CascadeType.ALL)
    @Cascade({ org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
    private Set<B> myBs = new HashSet<B>();


I also got a sub classe C which inherits from A.

When I try to delete a persisted instance of C, I get the following error:
org.hibernate.AssertionFailure: Unable to determine collection owner identifier for orphan-delete processing

I tried a whole lot of things before actually moving my relationship down into C and that did the trick.

So I was just wondering if that (the fact that the DELETE_ORPHAN does not 'span down' to sub classes) is a wanted behavior or a bug (or maybe I've just missed something)

Thanks

PS: I'm using Hibernate 3.3.1 with JPA


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.