-->
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: Reference on a MappedSuperClass
PostPosted: Thu Apr 09, 2009 6:02 am 
Newbie

Joined: Thu Apr 09, 2009 5:46 am
Posts: 1
Hi all,

I've a problem with the MappedSubClass annotation.

I'm working on a existing project with some classes :

class A & B which were independent- with their own id generator. Now I want to introduce a top class. I've written:

Quote:
@MappedSuperClass
public abstract class Top {
}

@Entity
public class A extends Top {
...
}

@Entity
public class B extends Top {
...
}


Everything seems OK, I can request for Top objects... Except that, when I try to create a ManyToOne relationship on class Top, it does not work :

Quote:
@Entity
public class C {

@ManyToOne
private Top endPoint ;

....
}


Quote:
org.hibernate.AnnotationException: @OneToOne or @ManyToOne on C.endPoint references an unknown entity: Top.


Is there a workaround? The main problem is I can't use another inheritance strategy because of the existing data.

Thanks per advance.


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.