Why are all my XYZCollectionViaEntityABC empty?

Posts   
 
    
Posts: 34
Joined: 08-Nov-2007
# Posted on: 03-Jan-2008 21:40:54   

I have several relations defined via intermediate tables e.g. Person --> PersonAddress -> Address and Person --> PersonNote --> Note yet the XYZCollectionViaEntityABC is always Count=0 despite PersonAddress and Address being fetched etc..

From the immediate window: ? person.NoteCollectionViaPersonNote.Count 0 ? person.PersonNote.Count 14 ? person.PersonNote[0].Note == null false ? person.PersonNote[1].Note == null false ? person.PersonNote[2].Note == null false

I use LLBLGen 2.5 with Adapter template. I fetch both PersonNote and subPath Note as you can see from the above, I don't understand how NoteCollectionViaPersonNote can be zero?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 04-Jan-2008 10:15:48   

If you want to populate the XYZCollectionViaEntityABC, then you should preftechPath it (i.e. use its own prefetchPath to fetch along with the main entity).

eg. Fetching a Person entity with a prefetchPath to PersonNote and a subPath to Note, will fetch the corresponding graph, but if you want to fetch the person.NoteCollectionViaPersonNote then you should use another prefetchPath for this one.