I solved the problem by myself :-)

It's enought to create an alias for the ChildNodes and "emit" the same
restrictions on the alias as well.

Really cool! I love NH :-)

.m

On Sep 27, 11:51 am, "Mauro Servienti" <[email protected]>
wrote:
> Hi all,
>
> I have a simple tree like this one:
>
> class Node
>
> {
>
>    String Name{ get; set; }
>
>    Node Parent{ get; set; }
>
>    IList<Node> ChildNodes{ get; set; }
>
> }
>
> What I need to do is retrieve the entire tree in one single round-trip to
> the db and I can achieve that by loading the entire table and letting the
> identity map works for me, it works like a charm.
>
> Now I need to achieve the same result but issuing a where condition, e.g.
> filtering all the nodes whose Name starts with "Foo*". The query works fine
> and, using NH Proof, I can see that the correct list of Node(s) are loaded
> but then accessing to the ChildNodes property issues a new sql command to
> load children.
>
> Is there a way to explain NH to use the same "condition" while loading the
> entire graph in order to go on using a single round-trip to the db?
>
> Thanks in advance, regards
>
> .m
>
> ___________________________________
>
> Mauro Servienti  | Microsoft MVP - Visual C#
>
> MCTS /MCPD- | IM: [email protected]
>
>  smime.p7s
> 8KViewDownload

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