"Missing" rows in EntityCollection mapped on View

Posts   
 
    
mCampbell
User
Posts: 1
Joined: 14-Sep-2005
# Posted on: 15-Sep-2005 00:25:54   

I have an Entity mapped on a View consisting of Address records joined to Address Type records (1:n relationship). When this collection is fetched I expect it to contain an entity for each record in the view. Instead it appears to be "grouping" the result and the collection only contains an entity for each distinct Address record. I captured the generated query and do not see a magic DISTINCT or GROUP BY. The result of the query is exactly what I expect. Is there something in the Collection logic that would explain this behavior?

This is a SelfServicing project and the issue occurs whether the collection is fetched using GetMulti with a predicate, or directly referencing the child collection from the parent entity.

Any insight you could provide would be greatly appreciated. Thanks and keep up the great work, Matt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 15-Sep-2005 09:25:42   

You have defined a field for the PK in the designer I pressume? As your view contains an 1:n relation, this means that there might be 2 or more rows with the same value for that field. These are seen as duplicates for the first row read with a given value for your PK field and skipped.

To solve this: make sure you pick a field which is truly unique in your resultset.

Frans Bouma | Lead developer LLBLGen Pro