-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: one-to-many - Store Procedure loader
PostPosted: Wed Mar 28, 2012 5:58 pm 
Newbie

Joined: Wed Mar 28, 2012 5:35 pm
Posts: 1
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.