grennis wrote:
Why do the NH docs say that "subclass" (one table per class hierarchy) is recommended over "joined-subclass" (one table per class)?
The name already says it: a joined subclass always uses a join when retrieving an object. Now this isn't too bad when you have a single subclass, but especially polymorphic queries with many different subclasses can result into lots of joins that might degrade performance.
As always: this is no golden rule. You have to test it for yourself if this is an issue or not.
Also, I might have forgotten something here, but there are some Java Hibernate docs that explain this stuff.
Quote:
Also, is it possible to use bags, many-to-one, etc., etc. with a joined-subclass? (i.e., only the subclass has these elements). The docs seem to indicate that it is not possible.
It is perfectly possible to do that.