I made a class with a nested generic collection of items. This collection is a
Domain.Objects.DomainObjectsList<Orders>.
This Collection is used in my Class
Invoice.
Code:
public class Invoice
{
// Properties
public virtual IList<Order> Orders
{
get
{
return FTestOrders;
}
}
private Domain.Objects.DomainObjectsList<Order> FTestOrders = new Domain.Objects.DomainObjectsList<Order>();
}
My mapping code looks like this:
Code:
<class name="Invoice" table="INVOICES" >
<id name="FKey" column="INV_KEY" type="Int32" length="4" unsaved-value="0" access="field">
<generator class="native"></generator>
</id>
<bag name="Orders" cascade="all" access="field" >
<key column="ORDER_KEY" />
<one-to-many class="Order"/>
</bag>
</class>
After one Invoice with some Orders are loaded from the database, the generic list of orders are type of
Code:
NHibernate.Collection.Generic.PersistentGenericBag`1[Domain.Objects.Order]
and
NOT type of
Code:
Domain.Objects.DomainObjectsList[Domain.Objects.Order]
.
How can i map the bag or a list to my own generic list?
Maybe i have to integrate a component?