I am trying to mix TPCH and TPS strategies on a class hierarchy, but can't quite grasp how to do it when the leaf classes contain collections or one-to-many references.
My naive approach (before reading the docs ;-) was
Code:
<class name="A" table="A">
<subclass name="B">
<joined-subclass name="C" table="C">
...
which parsed OK and also generated tables as I expected, but barfed at me when I tried to insert an instance of C, trying to insert class' C properties into table A.
After that I read the docs and tried the approach described in 10.1.4, i.e.
Code:
<class name="A" table="A">
<subclass name="B">
<subclass name="C">
<join table="C">
...
But, alas, I cannot use <set> or <one-to-many> or the like inside a <join>.
1. Was I just lucky that Hibernate parsed my first attempt and generated the tables correctly, or should that indeed work?
2. Out of curiosity: what is the rationale for not being able to use collections inside join tables? Are they simply treated as "unmanaged dead-ends" by Hibernate, so that it wouldn't manage detail tables on these?
3. Is there any straight-forward approach to accomplish my goal?
Thanks for any suggestions,
Olaf