if you use SetMaxResults=1 the "join fetch" is not needed.If you want avoid multiple DB-hit use multiquery.
2009/2/3 Tomas Tintera <[email protected]> > > I have object model with lazy loading (defined by project design). I > want to return first object (named Order) with one collection loaded. > The collection is named Items. So I try: > > - Create such HQL: > select r from Gmc.Fido.Domain.Order r inner join fetch r.Items where > (.....) > > - then set query.SetMaxResults = 1 > (query is of type NHibernate.IQuery) > > But this returns only firt item from the collection. Any idea what is > the correct way to get object with one collection loaded in one SQL > query? Using HQL. The project is not using criteria. > > > > > > -- 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 -~----------~----~----~----~------~----~------~--~---
