Here are the mapping files. When you update an object, only the modified objects are saved or all ?
Mapping of the parent object
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="PhenixPlus.model.client.dossier.prestation.PrestationPeriodique, PhenixPlus" table="PrestationPeriodique" >
<id name="PrestationID" column="ID" type="Int32" unsaved-value="0">
<generator class="identity" />
</id>
<many-to-one column="DossierId" name="Dossier" class="PhenixPlus.model.client.dossier.IDossier, PhenixPlus"/>
<many-to-one column="ParentId" name="Parent" class="PhenixPlus.model.client.dossier.prestation.DossierRepertoire, PhenixPlus"/>
<many-to-one column="OffreDetailId" name="OffreDetail" class="PhenixPlus.model.client.OffreDetail, PhenixPlus"/>
<many-to-one column="AgentId" name="Agent" class="PhenixPlus.model.personel.Utilisateur, PhenixPlus"/>
<many-to-one column="ObjetID" name="Objet" cascade="all" class="PhenixPlus.model.catalogue.Objet, PhenixPlus"/>
<property name="Statut" column="Statut" type="Int32" length="4" />
<property name="DateDepart" column="DateDepart" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />
<property name="PeriodeDB" column="Periode" type="String"/>
<property name="Frequence" column="Frequence" type="Int32" length="4" />
<property name="DisplayOrder" column="DisplayOrder" type="Int32" length="4" />
<bag name="PrestationsReelles" cascade="all" lazy="true" inverse="true">
<key column="PeriodiqueID"/>
<one-to-many class="PhenixPlus.model.client.dossier.prestation.PrestationPeriodiqueReelle, PhenixPlus"/>
</bag>
</class>
</hibernate-mapping>
Mapping file of the child object
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="PhenixPlus.model.client.dossier.prestation.PrestationPeriodiqueReelle, PhenixPlus" table="Prestation" >
<id name="PrestationID" column="ID" type="Int32" unsaved-value="0">
<generator class="identity" />
</id>
<discriminator column="Type" type="String" />
<many-to-one column="PeriodiqueID" name="PrestationPeriodique" class="PhenixPlus.model.client.dossier.prestation.PrestationPeriodique, PhenixPlus"/>
<many-to-one column="DossierId" name="Dossier" class="PhenixPlus.model.client.dossier.IDossier, PhenixPlus"/>
<many-to-one column="OffreDetailId" name="OffreDetail" class="PhenixPlus.model.client.OffreDetail, PhenixPlus"/>
<many-to-one column="AgentId" name="Agent" class="PhenixPlus.model.personel.Utilisateur, PhenixPlus"/>
<many-to-one column="ObjetID" name="Objet" cascade="all" class="PhenixPlus.model.catalogue.Objet, PhenixPlus"/>
<property name="DateRealisation" column="DateRealisation" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />
<property name="DateFin" column="DateFin" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />
<property name="HeurePrestee" formula="(select sum(p.Heure) from Pointage p where p.PrestationID= ID)"/>
<property name="DisplayOrder" column="DisplayOrder" type="Int32" length="4" />
<property name="Statut" column="Statut" type="Int32" length="4" />
</class>
</hibernate-mapping>