Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 89059 invoked from network); 5 Apr 2011 13:56:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Apr 2011 13:56:13 -0000 Received: (qmail 1964 invoked by uid 500); 5 Apr 2011 13:56:11 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 1902 invoked by uid 500); 5 Apr 2011 13:56:11 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 1894 invoked by uid 99); 5 Apr 2011 13:56:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 13:56:11 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Apr 2011 13:56:04 +0000 Received: from ben.nabble.com ([192.168.236.152]) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1Q76jP-0000vB-BJ for user@cayenne.apache.org; Tue, 05 Apr 2011 06:55:43 -0700 Date: Tue, 5 Apr 2011 06:55:43 -0700 (PDT) From: felix To: user@cayenne.apache.org Message-ID: <1302011743335-2779985.post@n3.nabble.com> Subject: paginated queries, setPageSize MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_133961_10523460.1302011743345" ------=_Part_133961_10523460.1302011743345 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I have integrated cayenne with a web framework (wicket) and pagination is crucial for the project we are implementing, however it doesnt seem to work, and im not sure whether im doing something wrong or I dont not understand the concept (there are 1004 'Proposal' objects in the database) When I do: ------------- SelectQuery q = new SelectQuery(Proposal.class); q.setPageSize(50); //FS: Casting WicketNotSerializableException with SimpleIdIncrementalFaultList(cayenne return class) queryRows = new ArrayList(MCApplication.getContext().performQuery(q)); -------------- I expected Cayenne to get all the IDs and the first 50 objects (1st page), however it seems it is fetching the 1004 objects. The log is the following: INFO - QueryLogger - --- will run 1 query. INFO - QueryLogger - --- transaction started. INFO - QueryLogger - SELECT t0.ProposalID FROM Proposal t0 INFO - QueryLogger - === returned 1006 rows. - took 10 ms. INFO - QueryLogger - +++ transaction committed. INFO - QueryLogger - --- will run 1 query. INFO - QueryLogger - --- transaction started. INFO - QueryLogger - SELECT t0.ProposalID, t0.ProposalTS, t0.CompanyFK, t0 FROM Proposal t0 WHERE (t0.ProposalID = ?) OR (t0.ProposalID = ?)............... - prepared in 30 ms. INFO - QueryLogger - === returned 1006 rows. - took 130 ms. INFO - QueryLogger - +++ transaction committed. I'd appreciate if someone could help me out. Thanks Felix -- View this message in context: http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2779985.html Sent from the Cayenne - User mailing list archive at Nabble.com. ------=_Part_133961_10523460.1302011743345--