Prefetches

Note: This feature is not available in NDO >= 4. It may be implemented again in future releases.

There are cases where the developer knows in advance that he will iterate through all child objects of a given object. In this case it is possible to load the child objects in advance:

var q = new NDOQuery<Employee>(condition); 
q.Prefetches.Add(x=>x.travels);

This code loads all Travel objects together with the Employee objects matching the condition. Instead of loading each Travel object in a separate SQL query (which would be the default behavior) this query only needs two SQL queries.