Component polymorphism (<subclass> within <component>)
------------------------------------------------------
Key: HHH-3455
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3455
Project: Hibernate3
Issue Type: Improvement
Components: core
Reporter: Jasper Blues
The following feature request occurs on the Hibernate forums from time to time - it would
be especially useful in mapping complex legacy schemas:
<class name="Critter">
<component name="breathingStrategy"
class="BreathingStrategy">
<discriminator column="BREATHING_STRATEGY" type="integer"
/>
<subclass name="Lungs" discriminator-value="0" >
<set name="alveoli">
<key column="CRITTER_ID" />
<one-to-many class="Alveolus" />
</set>
</subclass>
<subclass name="Gills" discriminator-value="1" >
<set name="alveoli">
<key column="CRITTER_ID" />
<one-to-many class="Gill" />
</set>
</subclass>
</component>
</class>
Will a patch that implements this feature be accepted?
What do you think if there was an option to inherit a discriminator from the owning
entity? How about some convention over configuration? By default the discriminator from
the owning entity is inherited, unless one is supplied at the component level.
Would an equivalent annotation mapping be required?
--
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