Hello,
I am having an issue with loading a store procedure result set into a <bag>. I know the SP is executing and returning results since I can see them in the Log4Net log. I just can't seem to get the results to properly map to the object I think. Any ideas?
Here is my mapping for the one-to-many
Code:
<class name="Bio">
<id name="Id" column="id" />
<property name="Title" column="title" />
<property name="FullName" column="fullname" />
<property name="FirstName" column="firstname" />
<bag name="Rel_List" where="end_date IS NULL" lazy="false">
<key column="id"/>
<one-to-many class="MyWeb.NHibernate.Common.Relations,Relations"/>
<loader query-ref="GetRelationsById" />
</bag>
</class>
Here is the mapping containing the sql-query
Code:
<class name="Relations" >
<id name="RelNo" column="rel_no" />
<property name="Id" column="id"/>
<property name="RelationId" column="relation_id" />
<property name="RelationName" column="relation_name" />
<property name="Rel" column="rel" />
<property name="RelationTxt" column="relation_txt" />
<property name="BegDate" column="beg_date" />
<property name="EndDate" column="end_date" />
<loader query-ref="GetRelationsById" />
</class>
<sql-query name="GetRelationsById">
<return class="Relations">
</return>
<![CDATA[EXECUTE PROCEDURE sp_GenRelationsById(:callingId)]]>
</sql-query>