Re: page pagination

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Oct 17 2003 - 18:22:51 EDT

  • Next message: Noel Murphy: "Help: ?Cyclic? Many to Many relationship"

    You are right. The beauty of this feature is that you don't have to do
    anything special. I mean beyond this simple method call, as mentioned
    by Eric:

    > selectQuery.setPageSize(20);

    In all other respects you use Cayenne as usual. A List returned from
    such query will internally and transparently resolve pages of objects
    when they are accessed. So if our Struts example worked for you, making
    it "paginated" on Cayenne side is as simple as calling the method
    above. For better performance select a "page size" to be equal to the
    number of objects you want to display per page. I leave it up to you to
    figure out the Struts part (e.g. you can display a "sublist" of the
    original list, corresponding to the current display page).

    Also, I believe I mentioned this doc page, but anyway, here is this
    link again:

          http://objectstyle.org/cayenne/userguide/perform/paged-queries.html

    Andrus

    On Friday, October 17, 2003, at 06:08 PM, Eric Schneider wrote:

    > What presentation framework are you using?
    >
    > From a cayenne perspective, all that is important is that you set the
    > page
    > size of the select query.
    >
    > selectQuery.setPageSize(20);
    >
    > If I'm remembering the behavior correctly, this will fetch a hollowed
    > list
    > of all results for the select query. Only the first 20 objects in the
    > List
    > will faulted. Is that correct Andrus?
    >
    > The rest his handled on the presentation side.
    >
    > Cheers,
    > e.
    >
    > ----- Original Message -----
    > From: "jini us" <jiniusu..ahoo.co.uk>
    > To: <cayenne-use..bjectstyle.org>
    > Sent: Friday, October 17, 2003 4:32 PM
    > Subject: page pagination
    >
    >
    >> Is there an example of page pagination implemented
    >> some where.
    >> Page Pagination is of particular interest to me
    >> as I am trying to implement it in my app.



    This archive was generated by hypermail 2.0.0 : Fri Oct 17 2003 - 18:22:53 EDT