Good Afternoon,
I have been trying to make sense of prefetch paths all afternoon yesterday but even searching through these forums I am still not sure I understand fully (which is probably due to me being new to LLBL so please bear with me).
I am using LLBL in adapter mode and I am trying to prefetch the following data structure in one go:
The database has three main tables : Missions, Fllights and Sectors. Each mission can have many flights and each flight in turn can have many sectors. So far this seems straight forward and I have been able to fetch all records by the following prefetch path:
prefetchPath.Add(MissionEntity.PrefetchPathFlight).SubPath.Add(FlightEntity.PrefetchPathSector);
However the Flight Entity has a one to many relation to a Route (each flight can have many route points). I can fetch this routepoint collection with the following prefetch path:
prefetchPath.Add(MissionEntity.PrefetchPathFlight).SubPath.Add(FlightEntity.PrefetchPathRoute);
When I try to combine the two:
prefetchPath.Add(MissionEntity.PrefetchPathFlight).SubPath.Add(FlightEntity.PrefetchPathSector);
prefetchPath.Add(MissionEntity.PrefetchPathFlight).SubPath.Add(FlightEntity.PrefetchPathRoute);
the following error is raised:
“The PreFetch Path elemet you are trying to add is already added to this prefetch path.”
Is there a way to achieve this or how should I split this into more entities? Any help is much appreciated!
Thanks,
Mike