Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 8177 invoked from network); 1 Jun 2007 15:44:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jun 2007 15:44:46 -0000 Received: (qmail 47360 invoked by uid 500); 1 Jun 2007 15:44:38 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 47350 invoked by uid 500); 1 Jun 2007 15:44:38 -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 47330 invoked by uid 99); 1 Jun 2007 15:44:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 08:44:38 -0700 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_10_20,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of blacknext@gmail.com designates 66.249.82.232 as permitted sender) Received: from [66.249.82.232] (HELO wx-out-0506.google.com) (66.249.82.232) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2007 08:44:32 -0700 Received: by wx-out-0506.google.com with SMTP id s16so519228wxc for ; Fri, 01 Jun 2007 08:44:12 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=t+qVPstRPW2wcZbHiZ4dGxmQYPx9O0m5qYv3QXmJisdHl2qeKFZa4kqK7LuzhnOfB/lXrQy+HzNYsLvoe1DDCz3AEh9vYFHJhCf7P86JxXd1Bl3K6SpKPCOM6IrMQFHW8sWAWckwa2rzwVOcuvQHG4sDeKEdExoZKs7LTLyJdVo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=TkM5W6xFGkv7AuPovhrF4cbjJQqLoawTgmaH0Hb7sNIPlIF6AWhhQtT9p3FksQMOaC3XP0ZhNohufRcJJ6t/Ukvfhz00rnQiNvBmbpxAJeVntBK8PL96b/Em2U3smfK9V9E//dS7Osn+YM31BzfZKj+CPTvWC8tJQ2GGwLIhFDo= Received: by 10.90.72.10 with SMTP id u10mr1918737aga.1180712651963; Fri, 01 Jun 2007 08:44:11 -0700 (PDT) Received: by 10.90.35.4 with HTTP; Fri, 1 Jun 2007 08:44:11 -0700 (PDT) Message-ID: Date: Fri, 1 Jun 2007 11:44:11 -0400 From: "Michael Gentry" To: user@cayenne.apache.org Subject: Re: performing count In-Reply-To: <49D23F7404DC5B4086D7352312597E0F01115C5E@FNHH-SVMEXDB002.Freenet-AG.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4644_29102593.1180712651922" References: <49D23F7404DC5B4086D7352312597E0F01115C5E@FNHH-SVMEXDB002.Freenet-AG.de> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_4644_29102593.1180712651922 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 = new CountQuery(Artist.class); int rowCount = query.getCount(); or even: int rowCount = 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 ------=_Part_4644_29102593.1180712651922--