I've faced a problem using DB2
I have two tables: ParentTable and ChildTable
----ParentTable-----------------------------------------
<id name="Id" column="ID" type="Int32">
<generator class="native">
</generator>
</id>
<property name="Name" column=""Name"" type="String" length="255" />
<set name="Children" cascade="delete-orphan" lazy="false" inverse="true">
<key column=""Parent_Id""/>
<one-to-many class="DataLayer.User, DataLayer"/>
</set>
----ChildTable-----------------------------------------
<id name="Id" column="ID" type="Int32">
<generator class="native">
</generator>
</id>
<property name="Name" column=""Name"" type="String" length="255" />
<many-to-one name="Parent" class="DataLayer.Parent, DataLayer" column=""Parent_Id"" />
When the "Child" table is empty everything is ok
otherwise I get an exception
[NHibernate.ADOException] {NHibernate.ADOException} NHibernate.ADOException
"could not initialize collection: [DataLayer.Parent.Children#1]"
Does anybody knows whats wrong
|