Hello All,
In reading through the docs and forum, I have seen reference to the composite-element mapping as an alternate way to define a parent/child relationship. However, I cannot find documentation on how to use it. Would someone please point me in the right direction.
For the curious, here is what I would like to accomplish:
I have a parent/child (one-to-many defining) relationship between two classes. The child is a lifecycle class and so has no existence beyond its parent. In the database, the child table's PK is comprised of a ChildID (synthetic integer) and an FK to the ParentID (also a synthetic integer).
From what I have read, I need a mapping like this in my Parent:
Code:
<bag name="Address" table="address" cascade="all-delete-orphan" lazy="false">
<key column="PersonID" />
<composite-element class="nHibTest.Address, nHibTest">
<property name="Street" column="street" type="String" />
<!-- rest of the properties -->
</composite-element>
</bag>
However, <id> is not a valid child of <composite-element> so I do not know how to map that column.
Any help would be appreciated.
Thank you for your time,
Jay