Description
Classes with an underscore in their name won't let you run XWQL queries with object properties clauses.
Steps to reproduce:
- Create a class 'XWiki.Speaker_Class'
- Add a static list attribute 'country' to it. Specify a list of values such as: 'fr|uk|cn|ja'
- Create a page 'Main.JohnDoe', add an XWiki.Speaker_Class object to it, select 'uk' from the country list
- Create a page 'Main.UkSpeakers' and add the following Velocity script to it:
{{velocity}} #set($xwql = "from doc.object(XWiki.Speaker_Class) as xobj where xobj.country='uk'") #set($results = $services.query.xwql($xwql).execute()) $results {{/velocity}}
The following error is then raised, while the same steps without the underscore in the class name return the expected result.
org.hibernate.QueryException: could not resolve property: country of: com.xpn.xwiki.objects.BaseObject [ select doc.fullName from com.xpn.xwiki.doc.XWikiDocument as doc , com.xpn.xwiki.objects.BaseObject as xobj where ( xobj.country = 'uk' ) and doc.fullName=xobj.name and xobj.className='XWiki.Speaker_Class' ]
The issue was reproduced against the XWiki playground, version 7.1.1. Note that the HQL transposition of the query returns the expected results.