openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Everton (JIRA)" <>
Subject [jira] Created: (OPENJPA-232) concat function in EJB QL doesn't nest
Date Wed, 02 May 2007 00:02:15 GMT
concat function in EJB QL doesn't nest

                 Key: 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",
	at org.apache.openjpa.kernel.jpql.JPQL.generateParseException(
	at org.apache.openjpa.kernel.jpql.JPQL.jj_consume_token(
	at org.apache.openjpa.kernel.jpql.JPQL.conditional_primary(
	at org.apache.openjpa.kernel.jpql.JPQL.conditional_factor(
	at org.apache.openjpa.kernel.jpql.JPQL.conditional_term(
	at org.apache.openjpa.kernel.jpql.JPQL.conditional_expression(
	at org.apache.openjpa.kernel.jpql.JPQL.where_clause(
	at org.apache.openjpa.kernel.jpql.JPQL.select_statement(
	at org.apache.openjpa.kernel.jpql.JPQL.parseQuery(
	at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(
	... 50 more

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

View raw message