Hey everyone. Returning to Hibernate and JEE after a hiatus of 5 years. Loving the new annotations stuff but finding myself a little stuck on how to handle inheritance mapping. I've read all the docs, please don't post a link there :)
I understand each inheritance mapping option (I think) when it applies to 2 classes, a parent and a subclass.
But what I am looking for is an example of a Parent, a subclass and a subclass of the subclass.
A --- B ------ C
I am imagining having a single table strategy for A and B using a discriminator. But I don't know how to then get C in on the act. Am I supposed to model the whole hierarchy from A through to C in one single table?
Or better perhaps is having A on its own in a table and then B would contain a foreign key to A's ID. B and C would then be the single table strategy. How would I express the annotations for A, B and C in this case?
Thanks so much, I hope this is not too vague.
|