Hello all,
Hibernate is really cool, simple and elegant.
I studied Chapter 6: Components (v2.0.2) and would like to know if subcomponents (similarly to class/subclass concept for mapping a class hierarchy) could be somehow supported?
I have checked the Hibernate 2.0 DTD and it does not seem to support it. Am I right?
The example from the Hibernate reference document shows a class "eg.Name" being a component of class "eg.Person":
Code:
<class name="eg.Person" table="person">
<id name="id" column="id" type="int">
<generator class="sequence"/>
</id>
<property name="birthday" type="date"/>
<component name="name" class="eg.Name">
<parent name="namedPerson"/> <!-- reference back to the Person -->
<property name="initial" type="char"/>
<property name="first" type="string"/>
<property name="last" type="string"/>
</component>
</class>
What could I do with subclasses of class "eg.Name", for example "eg.ChineseName" and "eg.OtherFancyName"? Can I use them as components of class "eg.Person"? If yes, how?
Any help is appreciated. Thanks,
Peter