Hi,
I've a object with a list:
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataModel" namespace="DataModel.Model"> <class name="Master"> <id name="Code" > <generator class="assigned" /> </id> <property name="Quantity" />
<bag name ="ExternalJobs" cascade="all-delete-orphan" table="ExternalJobs" lazy="true" > <key column="Code" /> <one-to-many class="ExternalJob" /> </bag> </class> </hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataModel" namespace="DataModel.Model"> <class name="ExternalJob"> <id name="Row" unsaved-value="0"> <generator class="assigned" /> </id> <property name="Operation" not-null="true"/> <property name="Quantity" /> </class> </hibernate-mapping>
In the class the bag is a IList. When I populate the object and then I call SaveOrUpdate, the first time the object is save, the second time, the ExternalJob table have two row, the first is the first inserted with code set to null and the second is the new updated valued row. Why is present this row with null value?
How to solve this problem?
|