I also want to embed a polymorphic reference.
emmanuel wrote:
The closest thing you can do today is to use @MappedSuperclass on your superclasses.
This is an Hibernate extension though
Can someone give details on this? No combination of @MappedSuperclass and @Inheritance annotations on the sub and super classes that I've tried gets hibernate to correctly persist subclasses.
This is essentially the model that I want to map
Code:
public abstract class ChildSuperClass {}
@Entity
public class Parent {
@Embedded
private ChildSuperClass child;
}
public class ChildA extends ChildSuperClass {
private int [] ASpecificField;
}
public class ChildB extends ChildSuperClass {
private String [] BSpecificField;
}
Thanks.