views:

12

answers:

0

I am currently using version 2.1.2.4 of NHibernate. I am attempting to fetch a child collection of pages for a chapter on a non-PK column by using the element mapping configuration. I obtain a property not found exception for property "chapterToPages", which is really just grouping the 2 properties on the class to create the the property-ref relation.

Is there something missing in the way this is mapped or is this feature not supported? (The nhibernate-mapping-2.2 xsd file does currently have support for this property)

Details for Mapping file for Chapter are:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" >
<class name="Chapter" table="Pages" >
<id name="Id" column="Id" type="Int32" unsaved-value="0">
<generator class="native"></generator>
</id>
<property name="foo1" column="foo1" type="string" length="255" not-null="true"/>
<property name="Number" column="ChapterNumber" type="Int32" not-null="true"/>
<properties name="chapterToPages" >
<property name="Manual" />
<property name="Number" />
</properties>
<bag name="Pages" table="Pages" generic="true" inverse="false" cascade="all" >
<key property-ref="chapterToPages" />
<one-to-many class="Page"/>
</bag>
<many-to-one name="Manual" class="Models" column="ManualId"/>
</class>
</hibernate-mapping>

related questions