Are you sure? I thought you
had to map every class/interface that could participate in a persistent relationship.
Let's complicate it a bit to see what I'm telling you... let's say I have the following:
Code:
Contactable Accountable (interfaces)
^ ^ ^
| | |
Company Party (interfaces)
^
|
SimpleParty (class)
Lest's say you only create mappings for concrete classes (Company and SimpleParty). Now you have some many-to-many association where the end of the association points to Contactable... how would Hibernate handle this, if possible?
I now you'll tell me that polymorphism is limited with the table-per-concrete-class strategy, but then let's suppose we use a table-per-class strategy (joined-subclass)... I cannot imagine how would this be handled in the case of the party table, as you should have a foreign key pointing to two tables, contactable and accountable.
And finally we have the table-per-class-hierarchy strategy... what should you do? A contactable table and an accountable table? Where would party objects be stored? Would Hibernate save the data in both tables when updating SimpleParty objects?
Best regards
Jose