Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 91489 invoked from network); 8 Apr 2008 12:23:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Apr 2008 12:23:26 -0000 Received: (qmail 12476 invoked by uid 500); 8 Apr 2008 12:23:26 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 12459 invoked by uid 500); 8 Apr 2008 12:23:26 -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 12450 invoked by uid 99); 8 Apr 2008 12:23:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2008 05:23:26 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gosho@oles.biz designates 87.126.30.246 as permitted sender) Received: from [87.126.30.246] (HELO mail.oles.biz) (87.126.30.246) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Apr 2008 12:22:44 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.oles.biz (Postfix) with ESMTP id 32207402BE for ; Tue, 8 Apr 2008 15:22:54 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at mail.oles.biz Received: from mail.oles.biz ([127.0.0.1]) by localhost (bambi2.oles.biz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XQWPU10GCYn6 for ; Tue, 8 Apr 2008 15:22:53 +0300 (EEST) Received: from [192.168.0.11] (unknown [192.168.0.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.oles.biz (Postfix) with ESMTPSA id 92B5E5F09D for ; Tue, 8 Apr 2008 15:22:53 +0300 (EEST) Message-ID: <47FB639D.6060501@oles.biz> Date: Tue, 08 Apr 2008 15:22:53 +0300 From: Georgi Naplatanov User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080109) MIME-Version: 1.0 To: users@openjpa.apache.org Subject: Re: problems with ESCAPE function References: <47FB5291.70806@oles.biz> In-Reply-To: <47FB5291.70806@oles.biz> X-Enigmail-Version: 0.95.0 OpenPGP: id=205362C6 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello, I forgot to say that OpenJPA version which I use is 1.0.2. Best regards Georgi Georgi Naplatanov wrote: > Hello, everybody. > > I tried to run the following JPQL query: > SELECT x From MyObject x WHERE x.path LIKE ?1 ESCAPE '|' > > but following exceptions occur: > > > org.apache.openjpa.persistence.ArgumentException: An error occurred > while parsing the query filter 'SELECT x From MyObject x WHERE x.path > LIKE ?1 ESCAPE '|''. Error message: nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException: > Encountered "ESCAPE" at character 125, but expected: ["AND", "GROUP", > "HAVING", "OR", "ORDER", ]. > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.(JPQLExpressionBuilder.java:1645) > at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:47) > at > org.apache.openjpa.kernel.ExpressionStoreQuery.newCompilation(ExpressionStoreQuery.java:144) > at > org.apache.openjpa.datacache.QueryCacheStoreQuery.newCompilation(QueryCacheStoreQuery.java:236) > at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:651) > at > org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:633) > at > org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:599) > at > org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:661) > at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1487) > at > org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:227) > at > org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277) > at MainTest.test1(MainTest.java:51) > at MainTest.(MainTest.java:31) > at MainTest.main(MainTest.java:108) > Caused by: > org.apache.openjpa.persistence.ArgumentException: Encountered "ESCAPE" > at character 125, but expected: ["AND", "GROUP", "HAVING", "OR", > "ORDER", ]. > at > org.apache.openjpa.kernel.jpql.JPQL.generateParseException(JPQL.java:9285) > at org.apache.openjpa.kernel.jpql.JPQL.jj_consume_token(JPQL.java:9162) > at org.apache.openjpa.kernel.jpql.JPQL.parseQuery(JPQL.java:75) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1658) > ... 15 more > > > I don't know where the problem is. > > In case parameter's placeholder (?1) is replaced with string ('mypath%' > for example) , all is fine. > > Best regards > Georgi