On a BelongsTo-side of a relation, there is no lazy loading, so your
OrderItems will load their order if it is referenced from the OrderItem
class. But you can load everything in one go with "from OrderItem i join
fetch i.Order where ..."

-Markus

2008/12/10 c.sokun <[EMAIL PROTECTED]>

>
> I just need a child object like this "from OrderItem i where i.Id
> between 1 and 10";
> When looking at sql_show there are more than just select * from
> OrderItem where Id between 1 and 10 but another sql was issue as well
> select * from Order ... like that.
>
> Patrick Steele wrote:
> > What does your hql query look like?  Are you doing a "join" or a "join
> fetch"?
> >
> > On Tue, Dec 9, 2008 at 10:10 PM, c.sokun <[EMAIL PROTECTED]> wrote:
> > >
> > > I've always used DetachedCriteria to filter my dataset I recently
> > > decided to try SimpleQuery<T> the result was surprising me.
> > > If I do a query on a child object I will get parent object load as
> > > well which cause  N+1 behavior.
> > >
> > > Is there a way to only load the child object with SimpleQuery<T>?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" 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/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to