Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 4395 invoked from network); 4 Jun 2007 06:27:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jun 2007 06:27:48 -0000 Received: (qmail 73310 invoked by uid 500); 4 Jun 2007 06:27:51 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 73295 invoked by uid 500); 4 Jun 2007 06:27:51 -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 73286 invoked by uid 99); 4 Jun 2007 06:27:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jun 2007 23:27:51 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [194.97.50.155] (HELO mout2.freenet.de) (194.97.50.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jun 2007 23:27:46 -0700 Received: from [194.97.55.191] (helo=mx7.freenet.de) by mout2.freenet.de with esmtpa (Exim 4.68) (envelope-from ) id 1Hv62G-0002fU-IS for user@cayenne.apache.org; Mon, 04 Jun 2007 08:27:24 +0200 Received: from fnhh-svmexfe002.freenet-ag.de ([194.97.108.43]:51195) by mx7.freenet.de with esmtp (port 25) (Exim 4.68 #1) id 1Hv62G-0005bJ-Ex for user@cayenne.apache.org; Mon, 04 Jun 2007 08:27:24 +0200 Received: from FNHH-SVMEXDB002.Freenet-AG.de ([195.4.20.141]) by FNHH-SVMEXFE002.Freenet-AG.de with Microsoft SMTPSVC(6.0.3790.1830); Mon, 4 Jun 2007 08:27:47 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: performing count Date: Mon, 4 Jun 2007 08:27:46 +0200 Message-ID: <49D23F7404DC5B4086D7352312597E0F01115C6E@FNHH-SVMEXDB002.Freenet-AG.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: performing count Thread-Index: AcekY9gE9BAG4K46ToKG7z8qqLu83ACDX5Ag From: =?iso-8859-1?Q?Peter_Schr=F6der?= To: X-OriginalArrivalTime: 04 Jun 2007 06:27:47.0724 (UTC) FILETIME=[77F26CC0:01C7A671] X-Virus-Checked: Checked by ClamAV on apache.org +1 from me=20 -----Urspr=FCngliche Nachricht----- Von: Michael Gentry [mailto:blacknext@gmail.com]=20 Gesendet: Freitag, 1. Juni 2007 17:44 An: user@cayenne.apache.org Betreff: Re: performing count Looking at that CountQuery class makes me think we should actually add = it to Cayenne as a utility class. Perhaps with two additional methods added: public int getCount(); public int getCount(DataContext dc); That way you could then do: CountQuery query =3D new CountQuery(Artist.class); int rowCount =3D query.getCount(); or even: int rowCount =3D new CountQuery(Artist.class).getCount(); I think that would simplify things and needing a count is a pretty = comment activity. Perhaps for more flexibility, it would be good to have a constructor that could take a WHERE clause, too, in case you only need counts matching certain criteria. Thoughts? /dev/mrg