-->
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: Multi level Inheritance
PostPosted: Mon Mar 03, 2008 3:45 pm 
Newbie

Joined: Thu Feb 14, 2008 10:43 pm
Posts: 8
Code:
  Animals (abstract)
/                  \
Cats (concrete)       Humans (concrete)


One table for Animals
One table for Cats
One table for Humans

I have modelled with Single Table Inheritance with Secondary Tables for child and it works perfectly (discriminator column = AnimalType (string)).

I can make query like "from Animals" and i obtain an instance of correct concrete classes.

Now i want to extend the designe to

Code:
  Animals (abstract)
/                  \
Cats (concrete)       Humans (abstract)
                           /\
           Woman (concrete)   Man (concrete)


Woman and Man reside on the same table of Humans, so no secondary tables for them.
Only a new discriminator column (on Humans table) = Sex

I haven't found out how to make it ?


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.