Changes for page Creating XWiki Components

Last modified by Simon Urli on 2023/10/10

<
From version < 48.1 >
edited by slauriere
on 2012/08/30
To version < 49.1 >
edited by slauriere
on 2012/08/31
>
Change comment: added basic info about the way queries can be executed from a component

Summary

Details

Page properties
Content
... ... @@ -315,6 +315,16 @@
315 315   }
316 316  {{/code}}
317 317  
318 +=== Querying the data model ===
319 +
320 +Queries can be performed by using an instance of a QueryManager, which can be obtained and used as follows :
321 +
322 +{{code}}
323 +QueryManager queryManager = (QueryManager) componentManager.getInstance(QueryManager.class);
324 +Query query = queryManager.createQuery(xwqlstatement,Query.HQL);
325 +List<Object> results = query.execute();
326 +{{/code}}
327 +
318 318  == The XWiki context ==
319 319  
320 320  Note that the XWiki context is deprecated. It was an older way of keeping track of the current request, which had to be passed around from method to method, looking like a [[ball and chain>>http://en.wikipedia.org/wiki/Ball_and_chain]] present everywhere in the code.

Get Connected