openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milosz Tylenda (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-232) concat function in EJB QL doesn't nest
Date Wed, 15 Apr 2009 14:57:15 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699226#action_12699226
] 

Milosz Tylenda commented on OPENJPA-232:
----------------------------------------

Hi Julien, I am afraid this issue might not be a duplicate of OPENJPA-920, rather a related
one only. Although the 2nd parameter to LIKE might give an error similar to OPENJPA-920, the
stack trace indicates that this is rather the 1st parameter which blows OpenJPA up (the nested
CONCATs).


> concat function in EJB QL doesn't nest
> --------------------------------------
>
>                 Key: OPENJPA-232
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-232
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 0.9.7
>         Environment: Using H2 as the target SQL dialect.
>            Reporter: Dan Everton
>
> I'm attempting to do a case insensitive search for a substring within the concatenation
of two columns. The EJB QL I came up with looks like this:
> where lower(concat(concat(e.firstname, ' '), e.surname))) like concat(lower(:name), '%')
> however trying to execute that results in the following parse exception. 
> Caused by: <0.0.0 nonfatal user error> org.apache.openjpa.persistence.ArgumentException:
Encountered "lower ( concat ( concat ( e . firstname , \' \' ) , e . surname ) ) )" at character
32, but expected: ["(", ")", "+", ",", "-", ".", ":", "<", "<=", "<>", "=", ">",
">=", "?", "ABS", "ALL", "AND", "ANY", "AS", "ASC", "AVG", "BETWEEN", "BOTH", "BY", "CONCAT",
"COUNT", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "DELETE", "DESC", "DISTINCT",
"EMPTY", "ESCAPE", "EXISTS", "FETCH", "FROM", "GROUP", "HAVING", "IN", "INNER", "IS", "JOIN",
"LEADING", "LEFT", "LENGTH", "LIKE", "LOCATE", "LOWER", "MAX", "MEMBER", "MIN", "MOD", "NEW",
"NOT", "NULL", "OBJECT", "OF", "OR", "ORDER", "OUTER", "SELECT", "SET", "SIZE", "SOME", "SQRT",
"SUBSTRING", "SUM", "TRAILING", "TRIM", "UPDATE", "UPPER", "WHERE", <BOOLEAN_LITERAL>,
<DECIMAL_LITERAL>, <IDENTIFIER>, <INTEGER_LITERAL>, <STRING_LITERAL>].
> 	at org.apache.openjpa.kernel.jpql.JPQL.generateParseException(JPQL.java:9322)
> 	at org.apache.openjpa.kernel.jpql.JPQL.jj_consume_token(JPQL.java:9199)
> 	at org.apache.openjpa.kernel.jpql.JPQL.conditional_primary(JPQL.java:1895)
> 	at org.apache.openjpa.kernel.jpql.JPQL.conditional_factor(JPQL.java:1873)
> 	at org.apache.openjpa.kernel.jpql.JPQL.conditional_term(JPQL.java:1739)
> 	at org.apache.openjpa.kernel.jpql.JPQL.conditional_expression(JPQL.java:1701)
> 	at org.apache.openjpa.kernel.jpql.JPQL.where_clause(JPQL.java:1548)
> 	at org.apache.openjpa.kernel.jpql.JPQL.select_statement(JPQL.java:90)
> 	at org.apache.openjpa.kernel.jpql.JPQL.parseQuery(JPQL.java:62)
> 	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1652)
> 	... 50 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message