Anyway I would say this is a bug. Don't you?
On 29 Mai, 18:43, Mohamed Meligy <
eng.mel...@gmail.com> wrote:
> If by Cartesian product you mean the join, then yes, this is how NHibernate
> do it.
>
> Is there a way to change that? Not in NHibenate stuff.
> I do it (actually been experimenting this for a few days) by making the
> collection property settable, having two future queries (calling
> .ToFututre() on LINQ query or Future() on QueryOVer query) one for parent
> and another for child, then mapping the child entities to parent manually in
> a loop.
>
> If you are worried about multiple fetch paths, then you should do one query
> per fetch path, this will make a cartisian product for the parent entity and
> child path in the query only. which is better than getting cartestian
> product of all paths at the same time. You'll not need to map the child
> paths from different queries to the parent as, since parent is already
> returned in each queries, and NH keeps only one instance of each object, the
> parent from any of the queries will already have all child collections
> populated from different queries loaded into it.
>
> If you try to load the children only without the parent though, it will not
> map them to the parent coming from other queries then. Because it only does
> that when the return of the query requires creating new instance of the
> parent (or reusing existing if already there from another query).
>