openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasha <>
Subject Case-insensitive ORDER BY in JPAQL
Date Mon, 13 Dec 2010 18:25:46 GMT


I am using an old version of OpenJPA (1.0, comes with Weblogic 10)

I have some code like: 

String queryStr = "SELECT someObjType " +
       " FROM SomeObjType someObjType " +
       " WHERE " +
...(big where clause)
       " order by someObjType.someFieldName";

(someFieldName is a string/varchar)

Now this works fine, but I have to change the ordering to case-insensitive
ordering by someObjType.someFieldName.  When I change the code to  order by
LOWER(someObjType.someFieldName) I get an exception: 
org.apache.openjpa.kernel.jpql.ParseException: Encountered "lower" at
character 336, but expected: [<IDENTIFIER>].

What is the correct way to do a case-insesitive ordering on a string field? 
There must be some way to do this without writing a native query (which
would greatly complicate my query in this case)
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message