Hello,
I have a table that exist of composite ids. A have two grids one displays the parent table en the other the child table. I need to update, insert and delete data in the grids. When I click save both grids date need to be saved. How do I do that with composite ids?
This is the mapping:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Domain.Parent,Domain" table="PARENT" lazy="true">
<id name="Id" type="int" column="ID" unsaved-value="0" access="nosetter.camelcase-underscore">
<generator class="native"/>
</id>
<property name="TsCreate" column="TS_CREATE"/>
<property name="TsMaint" column="TS_MAINT"/>
<property name="UsCreate" column="US_CREATE"/>
<property name="UsMaint" column="US_MAINT"/>
<bag name="ChildList" inverse="true" lazy="true" cascade="all">
<key column="IdParent" />
<one-to-many class="Domain.Child,Domain" />
</bag>
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Domain.Child,Domain" table="CHILD" lazy="true">
<composite-id>
<key-property name="Year" column="YEAR"/>
<key-many-to-one name="IdParent" column="ID_PARENT"/>
</composite-id>
<property name="TsCreate" column="TS_CREATE"/>
<property name="UsCreate" column="US_CREATE"/>
<property name="TsMaint" column="TS_MAINT"/>
<property name="UsMaint" column="US_MAINT"/>
</class>
</hibernate-mapping>
Thanks in advance
Nyh