Hi,
I can't find out how to make the following working :
@Table(name = "A") @AccessType("field") public abstract class A { ...}
@Entity @Table(name = "B") @AccessType("field") public class B extends A { @Id @GeneratedValue private long hId;
... }
@Entity @Table(name = "C") @AccessType("field") public class C extends B { @Id @GeneratedValue private long hId;
... }
The default behaviour seems to be ONE CLASS PER HIERARCHY. (Using default value for discriminant)
* if I put the @id (and long hId) in both B and C class, hibernate can't start telling that it's not possible to Override id. * if I remove the id in the class C, Hibernate start normally, then I can store object instance of B but not instance of C. It says : "No column Id found".
The question is : how can I make hibernate works for a more than one level of concrete class inheritance ? I'd like to instantiate and store (via hibernate) B & C instances. The problem seems to be where to place the Id ? how many of them is it legal to put ? where ?
Thx, JL.
|