Joined: Wed May 17, 2006 9:46 pm Posts: 3
|
Hi all,
I have a fairly complex mapping I'm trying to represent and I'd appreciate it if someone could help me out. I'm mapping a hierarchy which i have done successfully using joined-subclass. One of the subclasses has an array containing another class hierarchy. This hierarchy is represented using a discriminator and the class has no ID property. I cannot change the code.
So here is my basic mapping and where my questions come in:
<class name="events.TestParentOwnerParent" table="OWNERPARENT">
<id name="id" column="id" type="string">
<generator class="assigned"/>
</id>
<property name="prop" type="string"/>
</class>
<joined-subclass name="events.TestParentOwner" extends="events.TestParentOwnerParent" table="OWNER">
<key column="owner_id"/>
<array name="parents" table="TEST_PARENTS" cascade="all">
<key column="owner_id"/>
<list-index column="ARRAY_INDEX" />
<many-to-many column="TESTPARENT_ID" class="events.TestParent"/>
</array>
</joined-subclass>
<class name="events.TestParent" table="TEST_PARENT_TYPE" discriminator-value="AGC">
<id column="uid" type="long">
<generator class="native"/>
</id>
<discriminator column="TYPEA_CHILD_TYPE_DISCRIMINATOR" type="string" />
<subclass name="events.TestChildA" discriminator-value="HP">
<property name="host" type="string" />
<property name="port" type="int" />
</subclass>
<subclass name="events.TestChildB" discriminator-value="DG">
<property name="name" type="string" />
</subclass>
</class>
The above works but really I would like to inline TestParent and its children into the table representing the array in the TestParentOwner class eliminating the extra table. Does anyone know how to do this?
|
|