I'd like to prefetch some data from three related tables (KubusBoom -> BoomElement -> Tekstblok). The middle (BoomElement) table references itself (upto three levels deep in practice). A Tekstblok may be referenced by a BoomEelement located at any level.
I apply a predicate to both the first and the last table (using SubPath) and try to retrieve all related data at once using the GetMulti() method.
// Arrange to fetch all related BoomElementen and Tekstblokken at once
IPrefetchPath prefetchPath = new PrefetchPath((int)EntityType.KubusBoomEntity);
prefetchPath.Add(KubusBoomEntity.PrefetchPathBoomElementCollectionViaBoomElement).SubPath.Add( BoomElementEntity.PrefetchPathTekstblok, Construct_TekstblokPredicate());
// Get selected KubusBoom via selected ZaakType and all related entities
KubusBoomCollection colKubusBoom = new KubusBoomCollection();
colKubusBoom.GetMulti(Construct_KubusBoomstructuurPredicate(selectedZaakTypeID, selectedNiveau, currentUser), prefetchPath);
I do always retrieve a single, top-level (KubusBoom) entity as intended. I however also always get all related Tekstblokken; the SubPath predicate seems to be ignored.
When I retrieve the same data step-by-step applying the same predicates all is well but I would really like to prefetch the whole lot at once. Anybody here have an idea how to achieve this?
- LLBLGen Pro v1.0.2005.1 Final
- SelfServicing
- MS .NET Framework v2.0.50727
- SQL Server v8.00.2039