Prefetch Question?

Posts   
 
    
netLearner
User
Posts: 150
Joined: 18-Oct-2003
# Posted on: 02-Dec-2004 21:07:02   

Hi Frans

I have a scenario like this and i am wondering if it is possible to get the data using PrefetchPaths:

Customer has Orders Order has Details Detail has Products Order has Products

Here are the fields:

Customer Cols: Id

Order Cols: Id, OwnerId

Detail Cols: Id, OrderId

Product Cols: Id, OwnerId

I am trying to write a prefetch which will get me all of them in trip. Here is the equivalent sql which will work:

Select prod.* from Product prod join Order o on prod.OwnerId = o.Id where o.OwnerId = '00000000-0000-0000-0000-000086210173' union Select prod.* from Product prod join Details d on prod.OwnerId = d.Id join Order filter on o.Id = d.OrderId where o.OwnerId = '00000000-0000-0000-0000-000086210173'

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 03-Dec-2004 10:22:11   

I'm not sure what you want to do, as the sql you're showing is not fetching any other object type but products. This means you don't need a prefetch path but 2 fetches of product into the same entity collection. Or am I mistaken?

Frans Bouma | Lead developer LLBLGen Pro
netLearner
User
Posts: 150
Joined: 18-Oct-2003
# Posted on: 03-Dec-2004 23:13:37   

Please ignore my post Frans.

Thanks for help.