Hi,
does a mapping like the following make sense?
In a class RequestAnswer I want a collection of composite elements (RequestAnswerElements). Those are stored in another table, a join is done one the primary key of RequestAnswer.
From the DTD perspective this kind of mapping is allowed. Hibernate loads it perfectly. Is there a proposed way to handle such objects in Java (any experience with such a mapping?)
How does Hibernate knows to what parent object a composite element belongs? I guess I miss something in the picture, please bring some light into the dark...
Code:
<set name="requestAnswerElements" lazy="false" inverse="true" cascade="none" table="REQUEST_ANS_ELMT">
<key>
<column name="REQUEST_ANS_IX" />
<column name="REQUEST_ID" />
</key>
<composite-element class="RequestAnswerElement">
<property name="ownerId" type="long" column="OWNER_ID" not-null="true" length="11">
</property>
...
<many-to-one name="reportingData" class="Rptd" not-null="true" update="true" insert="true">
<column name="RPTD_ID" />
</many-to-one>
</composite-element>
</set>