openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakob Braeuchi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OPENJPA-2477) parsing error when package name contains "type"
Date Fri, 07 Feb 2014 22:27:21 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-2477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jakob Braeuchi updated OPENJPA-2477:
------------------------------------

    Description: 
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) 


  was:
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}
<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) 
{noformat}


> 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: 
> <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)

Mime
View raw message