First off let me appologize for my incomplete class description. I
have revised it below to reflect your assumptions
Class AClass{
public virtual ICollection<BClass> Bs {get; set;}
}
Class BClass{
public virtual DClass D {get; set;}
public virtual EClass E {get; set;}
}
class DClass {...}
class EClass {...}
however I have tried the FetchMany(..).ThenFetch(..) method chain at
the end of my linq query wrapped in parenthesis and receive the
following error.
"Query specified join fetching, but the owner of the fetched
association was not present in the select list"
I have tried the following linq queries and all have recieved the same
error
session.Query<AClass>().FetchMany(a => a.Bs).ThenFetch (b => b.D);
(from a in session.Query<AClass>() select a).FetchMany(a =>
a.Bs).ThenFetch (b => b.D);
(from a in session.Query<AClass>() from b in a.Bs where b.IsCurrent
select a).FetchMany(a => a.Bs).ThenFetch (b => b.D); (this assumes
there is a boolean property named IsCurrent in the B Class)
p.s. this is with NHibernate 3 beta 2
On Nov 4, 5:48 am, Stefan Wenig <[email protected]> wrote:
> from memory, if the nameless ICollection<BClass> was named 'Bs':
>
> (from a in session.Query<AClass>()
> ...
> select a)
> .FetchMany(a => a.Bs).ThenFetch (b => b.D)
> .FetchMany(a => a.Bs).ThenFetch (b => b.E);
>
> On 3 Nov., 14:40, birchoff <[email protected]> wrote:
>
> > Given the following model
>
> > Class AClass{
> > public virtual ICollection<BClass> {get; set;}
>
> > }
>
> > Class BClass{
> > public virtual DClass D {get; set;}
> > public virtual EClass E {get; set;}
>
> > }
>
> > class DClass {...}
>
> > class EClass {...}
>
> > How would I go about eager fetching the entire graph here using LINQ
> > and QueryOver in nh3
>
>
--
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.