Thanks for the link.  However I 've go the exact opposite issue.  My
stored procedure does not return more fields than there are properties
in my class. It returns LESS fields. In the Cutting class there are
properties such as URL, Type, etc, etc, but as shown below, the stored
procedure only returns Cuttingid and Headline.

Is that a problem or is there a workaround ?

<sql-query name="sp_NH_GetCuttings">
    <return class="DataTransfer.Cutting, DataTransfer" >
      <return-property name="Cuttingid" column="CuttingID" />
      <return-property name="Headline" column="Headline" />
  </return>
   exec sp_NH_GetCuttings
  </sql-query>

On 25 mar, 13:10, Fabio Maulo <[email protected]> wrote:
> http://nhforge.org/blogs/nhibernate/archive/2008/11/23/populating-ent...
>
> 2009/3/25 graphicsxp <[email protected]>
>
>
>
>
>
> > I've figured out the issue, my stored procedure is not returning the
> > same number of columns as what I've mapped in my class. Does this mean
> > I can't create a Cutting object from the stored procedure without
> > mapping ALL the fields again in each stored procedure !?
>
> > On 25 mar, 12:29, graphicsxp <[email protected]> wrote:
> > > I've debugged nhibernate, and in the function GetNamedQuery, the
> > > IQuery object that is returned contains a ReturnTypes property which
> > > throws an exception :
>
> > > query must begin with SELECT or FROM: exec [exec sp_NH_GetCuttings]
>
> > > Whatever that means.... Can someone help ?
>
> > > On 25 mar, 09:46, graphicsxp <[email protected]> wrote:
>
> > > > Hi,
>
> > > > I get an exception while calling a named query :
>
> > > >   <sql-query name="sp_NH_GetCuttings">
> > > >     <return class="DataTransfer.Cutting, DataTransfer" >
> > > >       <return-property name="Cuttingid" column="CuttingID" />
> > > >       <return-property name="Headline" column="Headline" />
> > > >   </return>
> > > >    exec sp_NH_GetCuttings
> > > >   </sql-query>
>
> > > >     public IList<Cutting> getCuttings()
> > > >     {
> > > >       return _session.GetNamedQuery("sp_NH_GetCuttings").List<Cutting>
> > > > ();
> > > >     }
>
> > > > The exception inner message is not helpful :
>
> > > > could not execute query
> > > > [ exec sp_NH_GetCuttings ]
> > > > [SQL: exec sp_NH_GetCuttings]
>
> > > > and if I go deeper :
>
> > > > column2_0_0_
>
> > > > The second one is even more useless...
>
> > > > Here's the stored procedure :
>
> > > > CREATE PROCEDURE sp_NH_GetCuttings
>
> > > > AS
> > > > BEGIN
> > > >         SELECT TOP 3 CuttingID, Headline FROM cutting
> > > > END
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to