First attempts with PreFetchingPaths

Posts   
 
    
gabrielk avatar
gabrielk
User
Posts: 231
Joined: 01-Feb-2005
# Posted on: 26-Jan-2006 10:32:46   

Hi All,

By running through the manual again I found out about this feature, and a situation I would think it's handy.

I've got Shifts (working shifts) which have their JobTitle via table Job and Client and JobLocation are link to the Job and also needed always in this situation.

So I tried:

IPrefetchPath prePath = new PrefetchPath((int)EntityType.ShiftEntity); prePath.Add(ShiftEntity.PrefetchPathJob).SubPath.Add(JobEntity.PrefetchPathRelation); prePath.Add(ShiftEntity.PrefetchPathJob).SubPath.Add(JobEntity.PrefetchPathJobLocation);

It worked with the 2nd one commented out, but I guess I don't understand it yet.

Can anyone give some pointers?

Greets, Gab

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 26-Jan-2006 14:28:26   

Please try the following:

IPrefetchPathElement2 prefetchPathElement = ShiftEntity.PrefetchPathJob;
prefetchPathElement.SubPath.Add(JobEntity.PrefetchPathRelation);
prefetchPathElement.SubPath.Add(JobEntity.PrefetchPathJobLocation);

IPrefetchPath prePath = new PrefetchPath((int)EntityType.ShiftEntity);
prefetchPath.Add(prefetchPathElement);

What was wrong is adding the ShiftEntity.PrefetchPathJob twice to the same prefetchPath

gabrielk avatar
gabrielk
User
Posts: 231
Joined: 01-Feb-2005
# Posted on: 26-Jan-2006 14:56:42   

Thanks!

Will try later, digging in something else now... :S