You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Catalina Wei (JIRA)" <ji...@apache.org> on 2010/09/03 19:13:32 UTC
[jira] Created: (OPENJPA-1782) Better error messages when parsing
JPQL literals
Better error messages when parsing JPQL literals
------------------------------------------------
Key: OPENJPA-1782
URL: https://issues.apache.org/jira/browse/OPENJPA-1782
Project: OpenJPA
Issue Type: Improvement
Components: query
Affects Versions: 2.1.0
Reporter: Catalina Wei
Assignee: Catalina Wei
A problem was found while using some Glassfish Java EE 6 samples with the OpenJPA provider.
The sample was using double quotes for a literal on the "NOT LIKE" expression instead of the required single quotes:
select count(l) from LogRecord l where l.record NOT LIKE "Canceling timer%"
We do not allow double quoted literals in JPQL queries. The above JPQL resulted an error with text message:
Lexical error at line 1, column 58. Encountered: "\"" (34), after : ""
Perhaps we can improve the message to something like:
Lexical error at line 1, column 58. Encountered: "\"" (34), after : "LIKE". Expected single quoted literal.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OPENJPA-1782) Accept double quoted string
literal in JPQL
Posted by "Catalina Wei (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907095#action_12907095 ]
Catalina Wei commented on OPENJPA-1782:
---------------------------------------
Double quoted string literals are allowed in JPQL.
A double quoted string literal starts with a double quote - " and ends with a double quote, but it can not contain a double quote.
A lexical error is reported if any double quotes appear within a double quoted string literal.
For example, the following string literals are valid:
"You're right"
"This is a double quoted string literal"
If you need double quote(s) in a string literal, enclose the string in single quotes, i.e. use single quoted string literal.
For example, the following single quoted string literal contains a double quote:
'This is a single quoted string literal that contains a double quote - ". '
> Accept double quoted string literal in JPQL
> -------------------------------------------
>
> Key: OPENJPA-1782
> URL: https://issues.apache.org/jira/browse/OPENJPA-1782
> Project: OpenJPA
> Issue Type: Improvement
> Components: query
> Affects Versions: 2.1.0
> Reporter: Catalina Wei
> Assignee: Catalina Wei
>
> A problem was found while using some Glassfish Java EE 6 samples with the OpenJPA provider.
> The sample was using double quotes for a literal on the "NOT LIKE" expression instead of the required single quotes:
> select count(l) from LogRecord l where l.record NOT LIKE "Canceling timer%"
> We do not allow double quoted literals in JPQL queries. The above JPQL resulted an error with text message:
> Lexical error at line 1, column 58. Encountered: "\"" (34), after : ""
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1782) Accept double quoted string literal
in JPQL
Posted by "Catalina Wei (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Catalina Wei updated OPENJPA-1782:
----------------------------------
Summary: Accept double quoted string literal in JPQL (was: Accept double quoted string liternal in JPQL)
> Accept double quoted string literal in JPQL
> -------------------------------------------
>
> Key: OPENJPA-1782
> URL: https://issues.apache.org/jira/browse/OPENJPA-1782
> Project: OpenJPA
> Issue Type: Improvement
> Components: query
> Affects Versions: 2.1.0
> Reporter: Catalina Wei
> Assignee: Catalina Wei
>
> A problem was found while using some Glassfish Java EE 6 samples with the OpenJPA provider.
> The sample was using double quotes for a literal on the "NOT LIKE" expression instead of the required single quotes:
> select count(l) from LogRecord l where l.record NOT LIKE "Canceling timer%"
> We do not allow double quoted literals in JPQL queries. The above JPQL resulted an error with text message:
> Lexical error at line 1, column 58. Encountered: "\"" (34), after : ""
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OPENJPA-1782) Accept double quoted string liternal
in JPQL
Posted by "Catalina Wei (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-1782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Catalina Wei updated OPENJPA-1782:
----------------------------------
Summary: Accept double quoted string liternal in JPQL (was: Better error messages when parsing JPQL literals)
Description:
A problem was found while using some Glassfish Java EE 6 samples with the OpenJPA provider.
The sample was using double quotes for a literal on the "NOT LIKE" expression instead of the required single quotes:
select count(l) from LogRecord l where l.record NOT LIKE "Canceling timer%"
We do not allow double quoted literals in JPQL queries. The above JPQL resulted an error with text message:
Lexical error at line 1, column 58. Encountered: "\"" (34), after : ""
was:
A problem was found while using some Glassfish Java EE 6 samples with the OpenJPA provider.
The sample was using double quotes for a literal on the "NOT LIKE" expression instead of the required single quotes:
select count(l) from LogRecord l where l.record NOT LIKE "Canceling timer%"
We do not allow double quoted literals in JPQL queries. The above JPQL resulted an error with text message:
Lexical error at line 1, column 58. Encountered: "\"" (34), after : ""
Perhaps we can improve the message to something like:
Lexical error at line 1, column 58. Encountered: "\"" (34), after : "LIKE". Expected single quoted literal.
It is possible to allow double quoted string literals in JPQL.
> Accept double quoted string liternal in JPQL
> --------------------------------------------
>
> Key: OPENJPA-1782
> URL: https://issues.apache.org/jira/browse/OPENJPA-1782
> Project: OpenJPA
> Issue Type: Improvement
> Components: query
> Affects Versions: 2.1.0
> Reporter: Catalina Wei
> Assignee: Catalina Wei
>
> A problem was found while using some Glassfish Java EE 6 samples with the OpenJPA provider.
> The sample was using double quotes for a literal on the "NOT LIKE" expression instead of the required single quotes:
> select count(l) from LogRecord l where l.record NOT LIKE "Canceling timer%"
> We do not allow double quoted literals in JPQL queries. The above JPQL resulted an error with text message:
> Lexical error at line 1, column 58. Encountered: "\"" (34), after : ""
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.