Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.5.1
-
Fix Version/s: 5.2-milestone-2
-
Component/s: Query
-
Labels:
-
Tests:Unit
-
Difficulty:Unknown
-
Documentation:N/A
-
Documentation in Release Notes:N/A
-
Similar issues:
Description
Hi.
Here a code to reproduce this issue:
With HQL, use LOWER() in the ORDER BY clause do the work:
{{velocity}} #set($hql = "SELECT prop.value FROM XWikiDocument doc, BaseObject obj, StringProperty prop WHERE doc.fullName = obj.name AND obj.className='XWiki.XWikiUsers' AND prop.id=obj.id AND prop.name='last_name' ORDER BY lower(prop.value)") #set($rs = $services.query.hql($hql).setLimit(10).execute()) $rs {{/velocity}} With XWQL, it does not work: {{velocity}} #set($xwql = "SELECT obj.last_name FROM Document doc, doc.object(XWiki.XWikiUsers) obj ORDER BY lower(obj.last_name)") #set($rs = $services.query.xwql($xwql).setLimit(10).execute()) $rs {{/velocity}}
It returns an exception :
Caused by: org.xwiki.query.jpql.parser.ParserException: [1,83] expecting: id at org.xwiki.query.jpql.parser.Parser.parse(Parser.java:1247)