Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 4596 invoked from network); 22 Feb 2010 14:19:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Feb 2010 14:19:35 -0000 Received: (qmail 79931 invoked by uid 500); 22 Feb 2010 14:19:35 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 79869 invoked by uid 500); 22 Feb 2010 14:19:34 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 79859 invoked by uid 99); 22 Feb 2010 14:19:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Feb 2010 14:19:34 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kwsutter@gmail.com designates 209.85.218.224 as permitted sender) Received: from [209.85.218.224] (HELO mail-bw0-f224.google.com) (209.85.218.224) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Feb 2010 14:19:27 +0000 Received: by bwz24 with SMTP id 24so1714021bwz.33 for ; Mon, 22 Feb 2010 06:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ZwaR49+SQyFPQMtDRh3VPSEY9pG+CfCWvu379tvNtZw=; b=gTxhnTFxUNN+6IExqDCHV4nBgxQaFtPsAvzeKz8mlufRyvpYvQTHAedJ9XP1uvK9Y1 UMEHT2SvsBQxrz5kNEASAb2p/UzJCv4CnCUGSYGZNCxfogxv9KmfRb1Lh/UGpvVmbQiz oOdLul0HqI7NnyLL5AbTyB7iBoGgILVLlGNHM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=wKJc+xJervMWZ3J9xQZRi9iaCB+0qCR4QBAf2Yo9zRnuQfanTpTATuXV3ZuEB9Pt6H FP6EaigYJgDyxee5VHj9FMJvsIFlACvx0KJIsFfMQHLV9kcoaHZwp8XAhTuyBmIYP1VH J5VubRbM06vChaRKnK3iUSL9lTNL2aqu4Dzfo= MIME-Version: 1.0 Received: by 10.204.33.210 with SMTP id i18mr1020332bkd.119.1266848345518; Mon, 22 Feb 2010 06:19:05 -0800 (PST) In-Reply-To: <000301cab222$bb64fb70$322ef250$@com> References: <014d01cab169$f43d4920$dcb7db60$@com> <015c01cab203$3f95ac20$bec10460$@com> <000301cab222$bb64fb70$322ef250$@com> Date: Mon, 22 Feb 2010 08:19:05 -0600 Message-ID: <89c0c52c1002220619p5ee8db41r993111b71086bbda@mail.gmail.com> Subject: Re: Query confusion From: Kevin Sutter To: users@openjpa.apache.org, cnd@cndavies.com Content-Type: multipart/alternative; boundary=00032555971e9e72c90480311d6e --00032555971e9e72c90480311d6e Content-Type: text/plain; charset=ISO-8859-1 Hi Chris, Which classloader issue are you referring to? Thanks, Kevin On Sat, Feb 20, 2010 at 5:49 AM, C N Davies wrote: > Thanks for the info Catalina, > > > > I would like to switch to OpenJPA 2.0 Beta but I hit one of the open issues > regarding the class loader. So I'm stuck! > > > > Thanks > > > > Chris > > > > > > From: catalina wei [mailto:catalina.wei@gmail.com] > Sent: Saturday, 20 February 2010 10:33 PM > To: users@openjpa.apache.org; cnd@cndavies.com > Subject: Re: Query confusion > > > > Chris, > sum(dl.bwCount) * dl.bwRate is a scalar expression. > In Java Persistence 1.0 spec, scalar expression is not allowed to appear as > a select item. That is why you are getting a syntax error. > JPQL in Java Persistence 2.0 spec has updated the syntax and the scalar > expression can be a select item. This support is available in OpenJPA 2.0.x > releases. > Could you try any OpenJPA 2.0.x releases ? > > Catalina > > On Sat, Feb 20, 2010 at 12:03 AM, C N Davies wrote: > > Thanks Daryl, > > > > Pretty obvious, why couldn't I see it! > > > > Now I see my next issue, here is my query truncated down to the specific > issue: > > > > Select sum(dl.bwCount) * dl.bwRate from DLine as dl; > > > > > org.apache.openjpa.persistence.ArgumentException: Encountered "*" at > character 111, but expected: [",", "FROM"]. > > at > org.apache.openjpa.kernel.jpql.JPQL.generateParseException(JPQL.java:9501) > > > > What is wrong with my "*" symbol? It is documented as supported. > > > > I tried like this: > > > > (sum(dl.bwCount) * dl.bwRate) > > > > Same issue L > > > > Thanks! > > > > Chris > > > > > > From: Daryl Stultz [mailto:daryl@6degrees.com] > Sent: Saturday, 20 February 2010 12:56 AM > To: users@openjpa.apache.org; cnd@cndavies.com > Subject: Re: Query confusion > > > > > > > On Fri, Feb 19, 2010 at 8:46 AM, C N Davies wrote: > > Hi, > > Select Name, Age, EmailAddress, Weight from com.mypackage.User were Age > > 25 > Using OpenJPA I only know I can query like this: > Select u from User where Age > 25 > > > > You can do this in JPA QL: > > > > select u.name, u.age, u.emailAddress, u.weight from User as u > > > > But getResultList() will return a list if User entities, but I only want > specific fields as would be returned by my standard SQL above. > > > > My above example will return an Object[]. Not especially easy to use, a Map > would be nice. But there it is. > > > -- > Daryl Stultz > _____________________________________ > 6 Degrees Software and Consulting, Inc. > http://www.6degrees.com > mailto:daryl@6degrees.com > > > > > > --00032555971e9e72c90480311d6e--