From version 45.4
edited by Vincent Massol
on 2019/02/09 09:27
To version 46.1
edited by Pascal Bastien
on 2019/07/31 11:10
Change comment: Add a query example to list all objects properties value (and a link to more hql query examples)

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.VincentMassol
1 +xwiki:XWiki.pbas
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -35,6 +35,7 @@
35 35  |Query listing all documents containing XWiki Objects (XObject) of a given XWiki Class (XClass)|##from doc.object(XWiki.XWikiUsers) as user##|##, BaseObject as obj where doc.fullName = obj.name and obj.className = 'XWiki.XWikiUsers'##
36 36  |Query on XObjects and filtering on XObject property value|##where doc.author = 'XWiki.LudovicDubost' and doc.object(XWiki.XWikiUsers).email like '%xwiki.com'##|##, BaseObject as obj, StringProperty as prop where doc.fullName = obj.name and obj.className = 'XWiki.XWikiUsers' and obj.id=prop.id.id and prop.id.name='email' and prop.value like '%xwiki.com' and doc.author ='XWiki.LudovicDubost'##
37 37  |Query on 2 XObjects|##where doc.object(XWiki.XWikiUsers).email like '%xwiki.com' and doc.object(XWiki.ArticleClass).content like '%ludovic%'##|##, BaseObject as obj, StringProperty as prop, BaseObject as obj2, LargeStringProperty as contentprop where doc.fullName = obj.name and obj.className = 'XWiki.XWikiUsers' and obj.id=prop.id.id and prop.id.name='email' and prop.value like '%xwiki.com' and doc.fullName=obj2.name and obj2.className='XWiki.ArticleClass' and obj2.id=contentprop.id.id and contentprop.id.name='content' and contentprop.value like '%ludovic%'##
38 +|Query listing all objects properties (MyClassPropertyName_Label) values sorted by id (MyClassPropertyName_Id) property of a given XWiki Class (MyLocation.MyClass). See [[other hql examples>>xwiki:Documentation.DevGuide.Scripting.velocityHqlExamples.WebHome||anchor="HGettingobjectsofaspecificclass"]]||##select prop.value from BaseObject obj, StringProperty as prop, StringProperty as propMyId where obj.className='MyLocation.MyClass' and prop.id.id=obj.id and prop.name='MyClassPropertyName_Label' and obj.id=propMyId.id.id and propMyId.id.name='MyClassPropertyName_Id' order by propMyId.value asc##
38 38  |Search blogs per category (MyCategory)|##where doc.fullName <> 'XWiki.ArticleClassTemplate' and :category member of doc.object(Blog.BlogPostClass).category##| ## //#set ($category = "blog.MyCategory")//##
39 39  ##, BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='Blog.BlogPostClass' and obj.name<>'Blog.BlogPostTemplate' and obj.id=prop.id.id and prop.id.name='category' and list='${category}' order by doc.creationDate desc##
40 40  |List all tags|##select distinct obj.tags from Document doc, doc.object(XWiki.TagClass) as obj##|##select distinct tag from BaseObject as obj, DBStringListProperty as prop join prop.list as tag where obj.className='XWiki.TagClass' and obj.id=prop.id.id and prop.id.name='tags'##
XWiki.XWikiComments[0]
Comment
XWiki.XWikiComments[1]
Comment
XWiki.XWikiComments[2]
Comment
XWiki.XWikiComments[3]
Date
... ... @@ -1,1 +1,1 @@
1 -2019-02-09 09:27:35.159
1 +2019-02-09 09:27:35.0

Get Connected