Prefetch multiple trees.

Posts   
 
    
netLearner
User
Posts: 150
Joined: 18-Oct-2003
# Posted on: 02-Mar-2005 03:24:31   

Is it possible to Prefetch multiple tree graphs: For ex: If i have CustId = 1 and 2 and i would like to prefetch all the orders and all details of the above Ids at 1 time. Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39801
Joined: 17-Aug-2003
# Posted on: 02-Mar-2005 09:56:11   

netLearner wrote:

Is it possible to Prefetch multiple tree graphs: For ex: If i have CustId = 1 and 2 and i would like to prefetch all the orders and all details of the above Ids at 1 time. Thanks.

Yes. Just specify a Prefetch path starting with customer, then add the order node to the subpath and the order details to that node's subpath. You can also fetch multiple branched trees.

IPrefetchPath path = new PrefetchPath((int)EntityType.CustomerEntity); path.Add(CustomerEntity.PrefetchPathOrders).SubPath.Add(OrderEntity.PrefetchPathOrderDetails);

Frans Bouma | Lead developer LLBLGen Pro
netLearner
User
Posts: 150
Joined: 18-Oct-2003
# Posted on: 04-Mar-2005 21:35:45   

Frans Is it possible to prefetch 2 unrelated collections. For Ex: If i have a table1 and tabl2 which are unrelated and i would like to get both of the collections at 1 time instead of: t1.GetMulti(null); t2.GetMulti(null);

Is there a way. Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39801
Joined: 17-Aug-2003
# Posted on: 04-Mar-2005 22:20:41   

No, and a prefetch path is not saving any database activity in that case, as it would also come down to just 2 collection fetches simple_smile Prefetch paths are for a graph with a single type as root (which can be one or more instances).

Frans Bouma | Lead developer LLBLGen Pro