I have Two Table , tableA and tableB.
tableA have column : tabAId, col2, col3 (tabAId primaryKey and Identity column.)
tableB have column : tabAId, name (tabAId is not null)
I have create Bag in hbm file of tableA, to maintain relation ship.
<bag name="tableB" lazy="true" inverse="false"
batch-size="25" cascade="all-delete-orphan">
<key column="tabAId" />
<one-to-many class="tableB" />
</bag>
When I try to update record in tableA it throw exception, where as I have list of child in tableA instance.
[NHibernate.Exceptions.GenericADOException] = {"could not delete collection: [MIHR.Entities.tableA.tableB#21][SQL: UPDATE dbo.tableB SET tabAId = null WHERE tabAId = @p0]"}
InnerException = {"Cannot insert the value NULL into column 'tabAId', table 'SA_MIHR_DEV.dbo.tableB'; column does not allow nulls. UPDATE fails.\r\nThe statement has been terminated."}