RE: Limit the result of a query.

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Dec 01 2004 - 10:18:37 EST

  • Next message: Mike Kienenberger: "Re: Problem commiting objects"

    Hi Alex,

    "Paginated" queries solution suggested by Gary is the way to go in your
    case as far as I can tell. Why do you think it won't work? Here is another
    link to detailed paginated query info:

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

    And fetch limit will obviously NOT work for anything but the first page...

    Andrus

    >> > The database contains 1000 of records. The first
    >> > time
    >> > user view a page, only 50 records are fetched &
    >> > displayed.
    >> > User will then click a link, presumeably the link
    >> > has a parameter (2,50) <- fetch the 2nd 50
    >> > records.
    >> > The page displays record 51-101
    >> > etc.
    >> > I'm looking for a method that does that.. (or
    >> > any other way to do it in Cayenne)..
    >> > setPageSize is not really what i want, although it
    >> > seems very good.
    >> > setFetchSize() seems good as well, but in my case
    >> > it will only satisfy the first time the user
    >> request
    >> > (i.e record 1-50). I can't think of a way to do
    >> > what I want with setFetchSize()...
    >> >
    >> >
    >



    This archive was generated by hypermail 2.0.0 : Wed Dec 01 2004 - 10:18:38 EST