... |
... |
@@ -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. |