Details
Description
In xwql group by queries work with single select lists but not with multiselect.
Example:
== Query with group on single select field ==
Works
{{velocity}} $services.query.xwql("select obj.databaseList1,count(doc.fullName) from Document as doc, doc.object(Help.Applications.Movies.Code.MoviesClass) as obj group by obj.databaseList1 order by obj.databaseList1").execute() {{/velocity}}
== Query with group on multiple select field ==
Does not work
{{velocity}} $services.query.xwql("select obj.staticList1,count(doc.fullName) from Document as doc, doc.object(Help.Applications.Movies.Code.MoviesClass) as obj group by obj.staticList1 order by obj.databaseList1").execute() {{/velocity}}
Generates:
Caused by: java.sql.SQLSyntaxErrorException: unexpected token: BY required: BY in statement [select list4_.XWL_VALUE as col_0_0_, count(xwikidocum0_.XWD_FULLNAME) as col_1_0_ from xwikidoc xwikidocum0_ cross join xwikiobjects baseobject1_ cross join xwikilists dbstringli2_ inner join xwikiproperties dbstringli2_1_ on dbstringli2_.XWL_ID=dbstringli2_1_.XWP_ID and dbstringli2_.XWL_NAME=dbstringli2_1_.XWP_NAME, xwikilistitems list4_ cross join xwikistrings stringprop3_ inner join xwikiproperties stringprop3_1_ on stringprop3_.XWS_ID=stringprop3_1_.XWP_ID and stringprop3_.XWS_NAME=stringprop3_1_.XWP_NAME cross join xwikilistitems list5_ where dbstringli2_.XWL_ID=list4_.XWL_ID and dbstringli2_.XWL_NAME=list4_.XWL_NAME and dbstringli2_.XWL_ID=list5_.XWL_ID and dbstringli2_.XWL_NAME=list5_.XWL_NAME and 1=1 and xwikidocum0_.XWD_FULLNAME=baseobject1_.XWO_NAME and baseobject1_.XWO_CLASSNAME='Help.Applications.Movies.Code.MoviesClass' and dbstringli2_.XWL_ID=baseobject1_.XWO_ID and dbstringli2_.XWL_NAME='staticList1' and stringprop3_.XWS_ID=baseobject1_.XWO_ID and stringprop3_.XWS_NAME='databaseList1' group by . order by stringprop3_.XWS_VALUE]
Attachments
Issue Links
- relates to
-
XWIKI-15321 XWQL "in element()" expression creates exception with DBStringListProperty classes
- Closed