Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 43980 invoked from network); 13 Feb 2008 20:08:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2008 20:08:55 -0000 Received: (qmail 4668 invoked by uid 500); 13 Feb 2008 20:08:48 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 4653 invoked by uid 500); 13 Feb 2008 20:08:48 -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 4644 invoked by uid 99); 13 Feb 2008 20:08:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Feb 2008 12:08:48 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aluink@gmail.com designates 209.85.146.180 as permitted sender) Received: from [209.85.146.180] (HELO wa-out-1112.google.com) (209.85.146.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Feb 2008 20:08:15 +0000 Received: by wa-out-1112.google.com with SMTP id k22so207938waf.0 for ; Wed, 13 Feb 2008 12:08:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=tJDY8HTx9Twr1yHAzo5C1e11svkKYBK25lQYDYPdTeY=; b=dOrwuVuO4MORHfO8OMbD7wka2audycyf22AtArM8JOVRsFTqAnKHQNB/MxSPYXPPedv8nS3rVXhGDoB+/BFSpGB8VttifcO8v+pmFXUD283OkqNf3l95qoCosfHnxXwxuyUJAvM9Lfty3XeVzwjSctHV0j14MT3xakCkrSs9tDo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WTmJ47YCjzfxBW1Fg1xpCzDGESsixlXgQRIj4xqLNC4RTBzJv1dzknwZ7NDe05+uE86N0G6w90/QRddhgGRWctY1QjU28Xc6NRBX9OBpZiZoVNpItk/GdqE1qHIFIkNdJqIhTswNokZsBt6Ypt4iHCZGqc6MTFNfK8oGGP5Rvvk= Received: by 10.114.209.1 with SMTP id h1mr387116wag.115.1202933303113; Wed, 13 Feb 2008 12:08:23 -0800 (PST) Received: by 10.115.17.15 with HTTP; Wed, 13 Feb 2008 12:08:23 -0800 (PST) Message-ID: Date: Wed, 13 Feb 2008 15:08:23 -0500 From: "Eric Polino" To: user@cayenne.apache.org Subject: Re: questions In-Reply-To: <72E59335-7068-4319-916D-17BB86541F49@objectstyle.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <72E59335-7068-4319-916D-17BB86541F49@objectstyle.org> X-Virus-Checked: Checked by ClamAV on apache.org On Feb 13, 2008 2:36 PM, Andrus Adamchik wrote: > On Feb 13, 2008, at 1:48 PM, Eric Polino wrote: > > 1. How do I count the rows of a query, without actually doing a full > > blown SelectQuery and counting the elements? ie: select count(*) from > > table; > > For aggregate queries I suggest EJBQLQuery (only available in 3.0)... > It uses the same approach of joins expressed as relationships as > SelectQuery, only it also allows aggregate expressions. E.g.: > > EJBQLQuery query = new EJBQLQuery("select count(a) from Artist a > WHERE a.artistName like 'X%'"); > Number count = (Number) DataObjectUtils.objectForQuery(query); Cool, but we've been having trouble upgrading to 3.0 (we're on 2.0). Short of upgrading for this feature, any suggestions on what we can do in 2.0? > Andrus > > -- "None are more hopelessly enslaved than those who falsely believe they are free." --Goethe "Freedom is living without government coercion." --Ron Paul (www.ronpaul2008.com)