Hi,
I am kind of lost, and was wondering if someone could help me with my problem.
I have an entity that contains items, I'll call it "ItemEntity", which is related to itself via another table, "ItemRelationEntity". Items is also related to a third table, ItemNoteEntity.
What I am trying to do is get a list of items, ItemCollection, and its related ItemRelatonCollection, for all ItemEntity entities where ItemNoteEntity exists for the ItemEntity entities.
I was able to get ItemEntity objects filtering correctly (only getting the items that have
notes), but when I try to traverse the tree that was pre-fetched, all the Item entities show up, regardless of whether there were notes or not.
Here's the code:
IPredicateExpression FilterRel =
(ItemNoteFields.F_Guid != System.DBNull.Value);
IPredicateExpression FilterItem =
(ItemNoteFields.F_Guid != System.DBNull.Value);
RelationCollection relations = new RelationCollection();
relations.Add(
ItemNoteEntity.Relations.ItemEntityUsingF_ItemGuid,
JoinHint.Right);
relations.Add(
ItemEntity.Relations.ItemRelationEntityUsingF_ItemGuid,
JoinHint.Left);
IPrefetchPath path = new PrefetchPath((int)EntityType.ItemEntity);
path.Add(
ItemEntity.PrefetchPathItemRelationLineage, 0, FilterRel, relations);
Items.GetMulti(FilterItem, 0, null, relations, path);
Can anyone assist? I am using LLBLGen 2.5.
Thanks,
Greg