hiberdude wrote:
lkline wrote:
If I understand you correctly, you are trying to avoid references from the abstract project to the concrete project and use the table per subclass inheritance mapping.
According to the Hibernate docs you should be able to have separate mapping files for your subclasses that use <joined-subclass> as a top level element (i.e. instead of class). These can reside in your concrete project. They will need to specify the class that they extend of course since they are not lexically inside a class definition.
I did this using <subclass> for the table per class hierarchy strategy.
Good luck.
Can you point me to the place in the docs? I would like to map class per table and I would have each class mapping in a separate file. I rather not nest the entire hierarchy in one file.
See section 5.1.14 in the pdf of the reference document. It's also in the book Hibernate in Action in section 3.6.4. It's quite straightforward. Just put your subclass mapping in a separate file and add the attribute 'extends' to it. E.g.
Code:
<subclass name="foo.bar.MySubclass" extends="foo.bar.MySuperclass">
...
</subclass>