Have a look to this example:
http://code.google.com/p/darioquintana/source/browse/trunk/Examples/NHibernateExamples/DeepNHibernate/DeepNHibernate.Tests/Queries/Fetch/Fixture.cs

The model is:

Order -> Line -> Article; and I'm getting whole subset of the graph using *join
fetch*.

On Mon, Oct 5, 2009 at 4:54 PM, Michael Hedgpeth <[email protected]>wrote:

>
> I have the following tree in WPF:
>
> Product
>  -> Feature
>      -> Subfeature
>          -> Test Case
>
> Each type is different, but they all have a Children and Parent
> property for navigating the tree.
>
> When using the WPF TreeView, if you expand one level, it will check
> the count of the "Children" property of every child that you
> expanded.  So if I expanded product it would do something like this
> (in the background):
>
> foreach (Feature f in product.Children)
>  showPlus = f.Children.Count;
>
> Thus, this creates a select N+1 issue.
>
> If I were handwriting the SQL, when product was expanded, I would load
> all of the Subfeatures with this query:
>
> select Subfeature.*
> from Product, Feature, Subfeature
> where Product.Id = @JustExpandedId
> and Subfeature.ParentId = Feature.Id
> and Feature.ParentId = Product.Id
>
> I can't seem to find a way to make it preload all of the children of a
> children collection.  Making the collection not lazy load does not
> seem to fix the problem.  What is the best way to do this?
> >
>


-- 
Dario Quintana
http://darioquintana.com.ar

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to