Issue Details (XML | Word | Printable)

Key: OPENJPA-259
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Ognjen Blagojevic
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenJPA

Ability to parse EJB QL multiline queries in orm.xml

Created: 13/Jun/07 11:33 AM   Updated: 19/Jun/07 09:51 PM
Return to search
Component/s: kernel
Affects Version/s: 0.9.7
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works OPENJPA-259.patch 2007-06-13 05:28 PM Craig Russell 0.3 kB
Environment: Windows XP

Resolution Date: 16/Jun/07 06:54 AM


 Description  « Hide
Multiline queries in orm.xml like this one

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

Fail to execute with exception:

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

Please, add the possibility to the parser to handle multiline queries.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell added a comment - 13/Jun/07 05:28 PM
This patch might do the trick. Anyone want to give it a try?

Craig Russell added a comment - 16/Jun/07 03:11 PM
Thanks for committing the patch and adding a test case.

The \f" was not accidental. It's white space as defined in the Java Language manual, which calls it "form feed". I added all the white space from the manual.

Patrick Linskey added a comment - 16/Jun/07 07:15 PM
> The \f" was not accidental. It's white space as defined in the
> Java Language manual, which calls it "form feed". I added
> all the white space from the manual.

Surely they meant \l (^L, or ASCII 12), not \f (^F, ASCII 6).

Craig Russell added a comment - 17/Jun/07 06:25 AM
Well, \n isn't ascii 14 and \t isn't ascii 20. They're just letters and don't translate literally into ascii.

Patrick Linskey added a comment - 19/Jun/07 09:51 PM
Sure enough. I somehow never noticed that the escape characters didn't correspond to their ASCII equivalents.