openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ognjen Blagojevic <ogn...@etf.bg.ac.yu>
Subject Error parsingEJB QL query (openjpa 0.9.7)
Date Wed, 13 Jun 2007 09:03:39 GMT
Hi all,

I have problem with EJBQL query in orm.xml file. If the query is 
single-line, like this:

<named-query name="Test.findAll">
    <query>
        select o from Test o
    </query>
</named-query>

then everything works just fine. But if I i try to split it into several 
lines, like this:

<named-query name="Test.findAll">
    <query>
        select o
          from Test o
    </query>
</named-query>

then I get the following exception (reformated for clarity):

<0.9.7-incubating nonfatal user error> 
org.apache.openjpa.persistence.ArgumentException:
An error occurred while parsing the query filter

           'select o
          from Test o'.
              
Error message: org.apache.openjpa.kernel.jpql.TokenMgrError: Lexical 
error at line 1, column 10.  Encountered: "\n" (10), after : ""

    at 
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1656)
    at 
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.<init>(JPQLExpressionBuilder.java:1639)
    at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:47)
...

Ani hints? How can I make a multi-line query?

Thanks,
Ognjen


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message