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 ?