Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 15949 invoked from network); 24 Feb 2010 02:21:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2010 02:21:44 -0000 Received: (qmail 22564 invoked by uid 500); 24 Feb 2010 02:21:44 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 22504 invoked by uid 500); 24 Feb 2010 02:21:44 -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 22494 invoked by uid 99); 24 Feb 2010 02:21:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Feb 2010 02:21:43 +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; Wed, 24 Feb 2010 02:21:36 +0000 Received: by bwz24 with SMTP id 24so100992bwz.33 for ; Tue, 23 Feb 2010 18:21:07 -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:cc:content-type; bh=PSAup2HP9SZPyo8lOwoBlS2PIjQAwsXqHy2RV29+Zas=; b=TDDmH0WDauehN+AVVIErCIA+24rK+lLIaaQOfpMHYYT4pIgKVFtch4VJ4YVXt34Qb9 z3Yl67KYslpDhoZikL8sU5g14dFkTTT2AgDbwzyShfgpQiu963kMG9V0PZxeSxwtRqu/ T+frSmoU3lyJIZHVPKCPtsDQQcKj11gD6q/E0= 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 :cc:content-type; b=HG2oksp0vpM5WorBmrx8f4cuyLfz9hPaBvk3Qtiz/JHnFt7MiPLtNzsdv4AFpr1kt4 +/LfP5JglSjuhuxghkW76hbtZDUCl885JLqlz0nIoY5XfuXx14fcOcNG0iGAzI7S35DF 6tv7R//WD8wfPAXspQ3/7aIz+vDVYlo+zwKQY= MIME-Version: 1.0 Received: by 10.204.0.84 with SMTP id 20mr4500625bka.5.1266978063010; Tue, 23 Feb 2010 18:21:03 -0800 (PST) In-Reply-To: <018201cab4ee$4739b1e0$d5ad15a0$@com> References: <014d01cab169$f43d4920$dcb7db60$@com> <015c01cab203$3f95ac20$bec10460$@com> <000301cab222$bb64fb70$322ef250$@com> <89c0c52c1002220619p5ee8db41r993111b71086bbda@mail.gmail.com> <00dc01cab432$d8bb04a0$8a310de0$@com> <89c0c52c1002230640y3074e6e0r76de95f038b92dcd@mail.gmail.com> <89c0c52c1002230736y70647a2cvc806f99ce07fd2@mail.gmail.com> <018201cab4ee$4739b1e0$d5ad15a0$@com> Date: Tue, 23 Feb 2010 20:21:02 -0600 Message-ID: <89c0c52c1002231821h383dd67fhf24e897d8c4b117d@mail.gmail.com> Subject: Re: Query confusion From: Kevin Sutter To: cnd@cndavies.com Cc: users@openjpa.apache.org, catalina wei Content-Type: multipart/alternative; boundary=00151750e318624a4e04804f5153 --00151750e318624a4e04804f5153 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable HI Chris, It sounds like you are having mixed luck... It's difficult when things are not consistent... :-) Let's assume the classloader issue is no longer applicable. Are you experiencing the JPQL issues with the 2.0 Beta? Or, with the 1.2.x code base? Catalina had originally replied that one of your JPQL issues was not defined by JPA 1.0, but was defined in JPA 2.0. So, I'm just clarifying your environment. Thanks for your patience. We'll get to the bottom of your questions soon. Thanks, Kevin On Tue, Feb 23, 2010 at 7:11 PM, C N Davies wrote: > Hi Kevin, > > > > It=92s a bit strange, because I had this issue when I was trying move up = to > 2.0Beta from 1.2.1 on the weekend. I found that Jira and used Nicolas=92 = patch > instead but the same issue occurred even after rebooting and running buil= d > clean on my application. So I went back to 1.2.1 because I had other thin= gs > to do. When you replied to my email on Monday I couldn=92t remember the e= rror > so I put Nicolas=92 patch back in so I could reproduce the error, but it = no > longer occurred. Then this morning I went back to the standard 2.0Beta ja= r > and it no longer has the error either. Nuts! > > > > After all of this I still have my original issue though, I can=92t use t= he > =93+=94 symbol in my query, how is everyone else doing addition? This is = the > piece of my query that will fail: > > > > Select sum(dl.bwCount * dl.bwRate) + sum(dl.clrCount * dl.clrRate) fr= om > DataLine =85blah blah > > > > > > I am trying to add the result of the two calculations, but will always > receive the error: > > > > Encountered "+" at character 222, but expected: [",", "FROM"]. > > at org.apache.openjpa.kernel.jpql.JPQL.generateParseException(* > JPQL.java:9501*) > > at org.apache.openjpa.kernel.jpql.JPQL.jj_consume_token(* > JPQL.java:9378*) > > at org.apache.openjpa.kernel.jpql.JPQL.from_clause(*JPQL.java:245*) > > at org.apache.openjpa.kernel.jpql.JPQL.select_statement(* > JPQL.java:88*) > > at org.apache.openjpa.kernel.jpql.JPQL.parseQuery(*JPQL.java:63*) > > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(* > JPQLExpressionBuilder.java:1740*) > > > > > > Also I found that I can=92t do this: > > > > Sum(dl.bwCount) * dl.bwRate because it will give me a similar parse error > with the =93*=94 symbol, so I had to move it inside the brackets instead= to et > it to work. I can=92t do that with this new query, I did try using it lik= e > this below, where I enclosed the whole calculation inside brackets, but i= t > then bitches about the starting bracket: > > > > > > Select ( sum(dl.bwCount * dl.bwRate) + sum(dl.clrCount * dl.clrRate) ) > from DataLine =85blah blah > > > > Chris > > > > > > > > *From:* Kevin Sutter [mailto:kwsutter@gmail.com] > *Sent:* Wednesday, 24 February 2010 2:37 AM > *To:* cnd@cndavies.com > *Cc:* users@openjpa.apache.org; Donald Woods; Rick Curtis > *Subject:* Re: Query confusion > > > > Hi Chris, > Looked at the referenced JIRA [1] a bit closer... You mentioned that you > ran with Nicolas' patch, but the call stack you posted still has the > validator getting loaded. It looks like Nicolas' patch comments out the > loading of the Validator and Agent in order to get around the original > errors. So, if you run with Nicolas' patch, do you still experience the > classloader problem or some other problem? > > Since you can't currently get around the classloading issue, then you > haven't been able to validate Catalina's statements about supporting the > jpql updates. Correct? > > I know that we have tested these validation and agent loaders in the JSE > environment and within the WebSphere environment. I'm wondering if the > classloading issue is related to the Tomcat classloading mechanism. > > Kevin > > > [1] https://issues.apache.org/jira/browse/OPENJPA-1410 > > On Tue, Feb 23, 2010 at 8:40 AM, Kevin Sutter wrote: > > Hi Chris, > I think I found the JIRA you were referring to... > https://issues.apache.org/jira/browse/OPENJPA-1410. > > I'm not sure what's in Nicolas's patched version. Since Donald is the > current assignee, I'll copy him on this reply to see if he has any other > ideas. And, I'll copy Rick since the JIRA seems related to some work tha= t > he has done in the past. > > Kevin > > > > On Mon, Feb 22, 2010 at 8:49 PM, C N Davies wrote: > > Hi Kevin, > > > > I can=92t find it in the Jira, but I added a comment on last Saturday, I > downloaded the patched version > apache-openjpa-2.0.0-beta\openjpa-all-2.0.0-svn-910423.jar to fix the iss= ue > however it did not fix the other issue of being able to use =93+=94 symbo= l in my > query. > > > > Chris > > > > > > *From:* Kevin Sutter [mailto:kwsutter@gmail.com] > *Sent:* Tuesday, 23 February 2010 1:19 AM > > > *To:* users@openjpa.apache.org; cnd@cndavies.com > *Subject:* Re: Query confusion > > > > 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 issu= es > 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 wan= t > specific fields as would be returned by my standard SQL above. > > > > My above example will return an Object[]. Not especially easy to use, a M= ap > would be nice. But there it is. > > > -- > Daryl Stultz > _____________________________________ > 6 Degrees Software and Consulting, Inc. > http://www.6degrees.com > mailto:daryl@6degrees.com > > > > > > > > > --00151750e318624a4e04804f5153--