Our system has a fairly deep (5 class) and wide (total of 8 classes) hierarchy that we are trying to map to our database. Our model (at least this part) looks something like this:
Code:
*A
| |
B *C
| | |
D E F
|
G
|
H
(* classes are abstract)
Our current data model is TPS, which maps to 8 tables (obviously). Unfortunately, queries against this model (especially classes F and G) are very unperformant, because of the number of joins required.
We have tried several ways of mapping this structure, all of which lead to their own problems. A full TPH gives us a giant (30 column) table with scores of unrelated data. Trying to use <join> to break out a few classes allows us to get class B out of the giant subclass table, but little else.
Hibernate does not support what we would like to do, which is mix TPS and TPH within a single hierarchy, preferably by combining classes F and G into a single table per hierarchy (possibly with H) while keeping the classes above them split out.
Any advice would be much appreciated. I don't suppose there's any chance of Hibernate expanding its support of mixing TPH and TPS anytime soon?