I try to display a collection for two days without success. I also read all the possible articles and forums, but still there. So here is the problem:
1) The collection class contains the private field "_internalCollection", which is displayed by NHIB.
2) The holding entity must set read-only data collection property.
3) I want to avoid implementing the NHibernate IUserCollectionType interface !!!
I did this with xml rendering and it works great. The WarehouseEntity element is a collection element. Warehouses are a readonly property in the OrgEntity class.
<component name="Warehouses" class="Core.Domain.Collections.EntitySet`1[Core.Domain.OrgStructure.IWarehouseEntity,Core],Core"> <set name="_internalCollection" table="`WAREHOUSE`" cascade="save-update" access="field" generic="true" lazy="true" > <key column="`WarehouseOrgId`" foreign-key="FK_OrgWarehouse" /> <one-to-many class="Domain.Model.OrgStructure.WarehouseEntity,Domain"/> </set> </component>
Any idea how I can do this with fluent NHibernate?
EDIT: Core.Domain.Collections.EntitySet`1 is the base class. It provides basic functions for working with collections and can correspond to any class that is an IEntity interface.
collections nhibernate fluent-nhibernate nhibernate-mapping
mynkow
source share