-->
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: Assistance for multi-level class structure
PostPosted: Tue Oct 18, 2011 11:18 pm 
Newbie

Joined: Tue Jul 14, 2009 11:00 am
Posts: 3
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.


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.