Hello,
I've problems when using lazy-loading of one-to-many collections.
Is it possible to have a collection (set) which itselfs also has a collection?
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">
<class name="transact.BusinessFramework.BusinessLayer.Interface.dc_etyProject, transact.BusinessFramework.BusinessLayer.Interface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=399323deb3dc2693" table="tblProject">
<id name="ID" column="ID" type="Int32">
<generator class="native" />
</id>
<property name="ProjectName" type="String" length="100"/>
<property name="ID_TargetPlatform" type="Int32"/>
<property name="ID_Language" type="Int32"/>
<property name="CompanyName" type="String" length="100"/>
<property name="Copyright" type="String" length="100"/>
<property name="ApplicationTitle" type="String" length="100"/>
<property name="ApplicationNamespace" type="String" length="200"/>
<property name="Version" type="String" length="20"/>
<property name="Description" type="String" length="4000"/>
<property name="OutputFolder" type="String" length="500"/>
<property name="TimestampCreated" type="DateTime"/>
<property name="TimestampChanged" type="DateTime"/>
<set
name="set_tblConnection"
inverse="true"
lazy="true"
cascade="all">
<key column="ID_Project"/>
<one-to-many class="transact.BusinessFramework.BusinessLayer.Interface.dc_tblConnection, transact.BusinessFramework.BusinessLayer.Interface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=399323deb3dc2693"/>
</set>
<set
name="set_etyRepositoryTypeFolder"
inverse="true"
lazy="true"
cascade="all"
order-by="RepositoryTypeFolder asc">
<key column="ID_Project"/>
<one-to-many class="transact.BusinessFramework.BusinessLayer.Interface.dc_etyRepositoryTypeFolder, transact.BusinessFramework.BusinessLayer.Interface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=399323deb3dc2693"/>
</set>
The listing obove showes a mapping with two sets.
set_tblConnection is a simple set of rows.
set_etyRepositoryTypeFolder is a collection of entities with an one-to-many association.
Robert