http://nhforge.org/doc/nh/en/index.html#querysql-load
2010/2/24 sianabanana <[email protected]> > Sorry Fabio, Im not with you. what do you mean <loader> > > On Feb 24, 2:56 pm, Fabio Maulo <[email protected]> wrote: > > not "CreatSQLQuery" but <loader> > > > > 2010/2/22 sianabanana <[email protected]> > > > > > > > > > > > > > I have a stored procedure i would like to run to popoulate my entity. > > > > > IQuery iq = session.CreateSQLQuery("exec myStoredProcedure") > > > .AddEntity("s", typeof(Shop)) > > > .AddJoin("t", "s.Types"); > > > > > var test = iq.List<Shop>(); > > > > > I have written this stored procedure to get around an N+1 problem with > > > Paging. > > > > > Shop has a Many to Many relationship with Type. > > > > > If i remove the AddJoin and select shop.* from my stored procedure, > > > then my shop entity loads up, but obviouly doesnt eager load the > > > types. > > > > > I think i need to use the AddJoin method to eager load my types but > > > cant seem to get it right. > > > > > I selected > > > ----- shop.*, shopTypes.*, types.* > > > ----- shop.*, types.* > > > > > but nothing seems to work. > > > > > I have even written the hql for this, and then added the selection > > > columns from this, but still it doesnt work. > > > > > Any ideas??? > > > > > -- > > > 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]<nhusers%[email protected]> > <nhusers%[email protected]<nhusers%[email protected]> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/nhusers?hl=en. > > > > -- > > Fabio Maulo- Hide quoted text - > > > > - Show quoted text - > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- 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.
