openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Morin-Brassard" <Guillaume_Morin-Brass...@dmr.ca>
Subject ParseException when using UPPER Keyword with an IN CLAUSE
Date Mon, 10 Nov 2008 14:59:12 GMT
Hi,

 

I'm trying to execute this query :

 

String queryString = "update Instance model set model.excluded = :value where upper(model.name)
in (:instances)";

 

But I get the following exception :

 

org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the query
filter 'update Instance model set model.excluded = :value where upper(model.name) in (:instances)'.
Error message: <4|false|0.9.7> org.apache.openjpa.kernel.jpql.ParseException: Encountered
"upper ( model . name ) in" at character 57, 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>].

 

 

I thought first it was because of the upper keyword but after a couple of tests, it seems
that the parser crashes when using a keyword like « upper » with the IN CLAUSE since the
following query does not throw any exception. I guess its a parsing bug :

 

String queryString = "update Instance model set model.excluded = :value where upper(model.name)
= :instances";

 

Thank you,

 

________________________________________________________

Guillaume Morin-Brassard
Conseiller en livraison de systèmes

Défense & Sécurité Publique

DMR, une division de Fujitsu Consulting (Canada) inc. 

 


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