Jakob Braeuchi created OPENJPA-2477:
---------------------------------------
Summary: parsing error when package name contains "type"
Key: OPENJPA-2477
URL: https://issues.apache.org/jira/browse/OPENJPA-2477
Project: OpenJPA
Issue Type: Bug
Components: jpa
Affects Versions: 2.2.2
Reporter: Jakob Braeuchi
i have a strange problem with a select new query:
"Encountered "type" at character 23, but expected: [<IDENTIFIER>]." while
parsing JPQL
"select new ch.brj.ekv.type.Auswertung$EinkauferBetrag(p.kauf.einkaufer.id,
p.kauf.einkaufer.name, SUM(p.betrag)) from Posten p where...
when i change the name of the package to ch.brj.ekv.pojo the query works. it
looks like if type is some kind of a keyword for openJPA. the same query works
in Hibernate and Eclipselink
stacktrace:
{noformat}i have a strange problem with a select new query:
"Encountered "type" at character 23, but expected: [<IDENTIFIER>]." while
parsing JPQL
"select new ch.brj.ekv.type.Auswertung$EinkauferBetrag(p.kauf.einkaufer.id,
p.kauf.einkaufer.name, SUM(p.betrag)) from Posten p where...
when i change the name of the package to ch.brj.ekv.pojo the query works. it
looks like if type is some kind of a keyword for openJPA. the same query works
in Hibernate and Eclipselink
stacktrace:
<openjpa-2.2.2-r422266:1468616 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: "Encountered "type" at
character 23, but expected: [<IDENTIFIER>]." while parsing JPQL "select new
ch.brj.ekv.type.KaufShort(k.id, k.datum, k.einkaufer.name, SUM(p.betrag)) from
Kauf k, in(k.posten) p where k.lastupdate between :von and :bis group by k.id,
k.datum, k.einkaufer.name order by k.datum asc". See nested stack trace for
original parse error.
at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:51)
at
org.apache.openjpa.kernel.ExpressionStoreQuery.newCompilation(ExpressionStoreQuery.java:154)
at
org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:672)
at
org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:654)
at
org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:620)
at
org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:682)
at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:589)
<openjpa-2.2.2-r422266:1468616 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: "Encountered "type" at
character 23, but expected: [<IDENTIFIER>]." while parsing JPQL "select new
ch.brj.ekv.type.KaufShort(k.id, k.datum, k.einkaufer.name, SUM(p.betrag)) from
Kauf k, in(k.posten) p where k.lastupdate between :von and :bis group by k.id,
k.datum, k.einkaufer.name order by k.datum asc". See nested stack trace for
original parse error.
at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:51)
at
org.apache.openjpa.kernel.ExpressionStoreQuery.newCompilation(ExpressionStoreQuery.java:154)
at
org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:672)
at
org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:654)
at
org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:620)
at
org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:682)
at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:589)
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)