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.