Hi,
The idea of having a table with a discriminator column is the following: each row of the table represents a single class, i.e. one row is either a classB, or a classC; but not both (sure you can do a type cast in your code, but now we are talking only about o/r mapping).
So, I think, the answer to your question is the following: specify all the discriminator values for the bottom levels (classC's and classB's that are not inherited by any of the classC's) in the classA <discriminator> tag. Then, classB's that ARE inherited by classC's should NOT have discriminator-value; instead, hibernate should automagically determine this from the underlying classC's. I haven't tested if this works. But, I think it's worth trying. If I were a hibernate developer, I would've done it this way.
Greetings,
Mitko
|