[xwiki-users] Questions about HQL and "order by" issues
Hello everybody! I need a few help about HQL issues. 1) I have own class XWiki, and make query with sorting results by the class properties values, BUT not only one property. I wrote: #set ($hql = ", BaseObject as obj, StringProperty as prop where obj.name=doc.fullName and obj.className='XWiki.ProjectClass' and obj.name not like '%ClassTemplate' and obj.id=prop.id.id and prop.id.name='ProjectName' order by prop.value asc") this code greatly works, but sorting by only one property 'ProjectName'. How I can include in HQL query 2 sorting criterias (second "inside" first)? 2) My code order data by property values, but first always stay property values starting with alphabetical symbols and only second - values starting with numbers. For example: "ADSL", "DFR", "5SQL", "9ROOT". It is normal for HQL? Can I change this? It is better for me, if values starting with numbers will stay in a first positions ... Thanks beforehand! Eugen -- View this message in context: http://xwiki.475771.n2.nabble.com/Questions-about-HQL-and-order-by-issues-tp... Sent from the XWiki- Users mailing list archive at Nabble.com.
For the first question, I think, I already found the solution: #set ($hql = ", BaseObject as obj, StringProperty as prop, StringProperty as otherprop where (obj.name=doc.fullName and obj.className='UAProjectManagementCode.StepClass' and obj.name not like '%ClassTemplate') and (obj.id=prop.id.id and prop.id.name='Project') and (obj.id=otherprop.id.id and otherprop.id.name='Step') order by prop.value asc, otherprop.value asc ") but for the second answer about sorting order if numbers and symbols stay together, as before - I need some help ... -- View this message in context: http://xwiki.475771.n2.nabble.com/Questions-about-HQL-and-order-by-issues-tp... Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (1)
-
Colesnicov Eugen