[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1233?page=c...
]
Wouter Lievens commented on HHH-1233:
-------------------------------------
I would very much like to see this implemented. I'm using a single-root class
hierarchy with almost a hundred domain classes in the tree. Some of these classess only
contribute their change in type, and have few or no properties at all. Such a subtree
could be collapsed into a single-class hierarchy if it were allowed.
This will require a change to the DTD, and to the code as well.
Allow mixing <union-subclass>and <subclass>
-------------------------------------------
Key: HHH-1233
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1233
Project: Hibernate3
Type: Improvement
Components: core
Environment: N/A
Reporter: Gunther Schadow
BACKGROUND:
Hibernate allows mixing <subclass> and <joined-subclass> inheritance mappings
but apparently not <subclass> and <union-subclass> mappings, however, this
seems like the most useful combination. Example:
USE CASE:
We may have a hierarchy with very unevenly distributed mass, i.e., some subclasses have
millions of objects, others have only a half-dozen. There may be a lot of different
subclasses of the smaller sort.
Union-subclass seems ideal to work with a dozen different humongous tables, as they can
be placed on different tablespaces and managed differently. However, for the 200 or so
subclasses whith only a dozen objects each, it would be easier to map these into a single
table per sub-hierarchy.
REQUESTED FEATURE:
Therefore it seems fair to suggest that <subclass> mappings should be supported
underneath <union-subclass> mappings. To allow that the <discriminator>
element would have to be handled inside a <union-subclass> element and same for the
discriminator-value attribute. Perhaps one could limit the complexity by requiring that
the outer mapping must be union-subclass and the inner can be subclass but not vica
versa?
WORKAROUNDS:
As the documentation mentions one could just create several independent <class>
hierarchies, thus effectively emulating the first level of union-subclass specializations.
But that would not allow specifying polymorphic associations.
ESTIMATED EFFORT:
It could be difficult to implement support for this. But would like to know whether this
is something that is somewhere on the radar screen for the future.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira