sorting and paging at the same time

Posts   
 
    
andieje
User
Posts: 28
Joined: 17-May-2006
# Posted on: 16-Jun-2006 15:55:40   

Hi

I have seen in the user manual that you get apply paging on a set of entities as follow

orders.getMult(filter,0,nothing, relations,4,10) (p1.97 user manual)

In this example there is no sorting

assuming there is some sort criteria applied, i want to double check that getMulti, retrieves the records sorted in the correct order and then grabs the relevant page of records rather than grabbing a page of records and then sorting them afterwards. Obiviously the second approach will give you the wrong data (and I have seen this approach far too many times!)

thanks andrea

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 16-Jun-2006 16:10:24   

I have a hard time finding a question in your posting. What's the problem at hand? Are you curious which sort algo is used when you specify a sortclause? If you use the overload which accepts a sortexpression, the data is first sorted, then paged, as it should be done. LLBLGen Pro tries to produce queries which are correct. If it can't do that on the server side, it switches over to client side actions if those will result in correct result (example of that is DISTINCT fetching with a limit when a join is used which results in duplicates: TOP Can't be used in that case if DISTINCT can't be applied. If DISTINCT can't be applied due to distinct violating types, client-side limitations are applied instead.

Frans Bouma | Lead developer LLBLGen Pro
andieje
User
Posts: 28
Joined: 17-May-2006
# Posted on: 16-Jun-2006 16:54:05   

Hi

Sorry if i didn't word my question very well. I wanted to double check that records are sorted then paged (as it should be). YOu confirmed that this is the case.

Thanks