Fetch only some entities for collection

Posts   
 
    
shennig
User
Posts: 48
Joined: 14-Nov-2006
# Posted on: 21-Dec-2006 16:18:07   

Hi.

I want to fetch only a limited number of entities for a collection.

For example i want to fetch in a loop only 100 entities per round. First round 1-100, second round 101-200, and so on.

Is this possible?

I'm using Gen Pro 2.0.0 with an Adapter in .Net 2.0

Thaks,

hennig

gabrielk avatar
gabrielk
User
Posts: 231
Joined: 01-Feb-2005
# Posted on: 21-Dec-2006 17:02:59   

Hi,

sounds like paging, so use that functionality. You give page size and which page you want to load in the GetMulti() overload:

_Paging through an entity collection is implemented in an overload of GetMulti(). The particular overload accepts the page size, which is the number of objects to retrieve in the fetch action, and the page number to retrieve. If you for example pass 10 for the page size and 4 for the page number, you'll get record number 31-40, the first record is 1, the first page is also numbered 1. Paging is disabled if you pass 0 for the page number or 0 or 1 for the page size. _

Cheers, G

shennig
User
Posts: 48
Joined: 14-Nov-2006
# Posted on: 22-Dec-2006 09:15:34   

gabrielk wrote:

Hi,

sounds like paging, so use that functionality. You give page size and which page you want to load in the GetMulti() overload:

Thats right, but that hits only SelfServicing Template code. I'm using Adapter Template Code and there i haven't found something like GetMulti().

What could i use for Adapter?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 22-Dec-2006 09:31:12   

See: using the generated code -> adapter -> Collection / typedlist/typedview paging in the documentation.

Frans Bouma | Lead developer LLBLGen Pro
shennig
User
Posts: 48
Joined: 14-Nov-2006
# Posted on: 22-Dec-2006 10:15:29   

Otis wrote:

See: using the generated code -> adapter -> Collection / typedlist/typedview paging in the documentation.

Thanks that helps!