openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georgi Naplatanov <go...@oles.biz>
Subject problems with ESCAPE function
Date Tue, 08 Apr 2008 11:10:09 GMT
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:

<openjpa-1.0.2-r420667:627158 nonfatal user error>
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: <openjpa-1.0.2-r420667:627158
nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException:
Encountered "ESCAPE" at character 125, but expected: ["AND", "GROUP",
"HAVING", "OR", "ORDER", <EOF>].
	at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665)
	at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(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.<init>(MainTest.java:31)
	at MainTest.main(MainTest.java:108)
Caused by: <openjpa-1.0.2-r420667:627158 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: Encountered "ESCAPE"
at character 125, but expected: ["AND", "GROUP", "HAVING", "OR",
"ORDER", <EOF>].
	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

Mime
View raw message