TypedView and DISTINCT

Posts   
 
    
Marin
User
Posts: 9
Joined: 10-Dec-2006
# Posted on: 10-Dec-2006 19:08:44   

Hi all!

When TypedView Fill() method is generated, it looks as follows:

public virtual bool Fill(long maxNumberOfItemsToReturn, ISortExpression sortClauses, bool allowDuplicates, IPredicate selectFilter, ITransaction transactionToUse, 
            IGroupByCollection groupByClause, int pageNumber, int pageSize)
        {
            // Build resultset
            IEntityFields fieldsInResultset = GetFields();
            
            // __LLBLGENPRO_USER_CODE_REGION_START AdditionalFields
            // be sure to call fieldsInResultset.Expand(number of new fields) first. 
            // __LLBLGENPRO_USER_CODE_REGION_END
            TypedListDAO dao = DAOFactory.CreateTypedListDAO();
            return dao.GetMultiAsDataTable(fieldsInResultset, this, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, ***true***, groupByClause, transactionToUse, pageNumber, pageSize);
        }

allowDuplicates parameter is ignored, and true is used in its place (marked with ***). Is this on purpose? Why?

Thanks for replies simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 10-Dec-2006 19:21:01   

It's a design flaw / bug. I'll fix this.

Frans Bouma | Lead developer LLBLGen Pro
Marin
User
Posts: 9
Joined: 10-Dec-2006
# Posted on: 11-Dec-2006 10:42:39   

Otis wrote:

It's a design flaw / bug. I'll fix this.

Thanks! simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 11-Dec-2006 11:17:52   

Fixed in build 12112006 of the tasks and templates archive.

This bug is really harmless though. As in LLBLGen Pro you don't join with other entities using a typedview, all duplicates in the resultset are removable by adding DISTINCT to the view's SELECT command.

Frans Bouma | Lead developer LLBLGen Pro
Marin
User
Posts: 9
Joined: 10-Dec-2006
# Posted on: 11-Dec-2006 12:39:17   

Otis wrote:

This bug is really harmless though. As in LLBLGen Pro you don't join with other entities using a typedview, all duplicates in the resultset are removable by adding DISTINCT to the view's SELECT command.

True.. but in our case this was done in the code so we noticed it wink