@Component @Named(value="query") @Singleton public class QueryManagerScriptService extends Object implements org.xwiki.script.service.ScriptService
| Constructor and Description |
|---|
QueryManagerScriptService() |
| Modifier and Type | Method and Description |
|---|---|
Query |
createQuery(String statement,
String language)
Create a Query for the given statement and language.
|
Query |
hql(String statement)
Shortcut for writing a HQL query.
|
QueryParameter |
parameter()
Allow creating query parameters.
|
Query |
xwql(String statement)
Shortcut for writing a XWQL query.
|
public Query xwql(String statement) throws QueryException
statement - the XWQL statement for the queryQueryException - if any errorspublic Query hql(String statement) throws QueryException
statement - the HQL statement for the queryQueryException - if any errorspublic Query createQuery(String statement, String language) throws QueryException
statement - the query statementlanguage - language of the query. Must be a supported language.QueryException - if language is not supportedpublic QueryParameter parameter()
#set ($queryParams = [])
#set ($whereQueryPart = "${whereQueryPart} AND doc.space = ?")
#set ($discard = $queryParams.add($services.query.parameter().literal($request.space)))
QueryParameter for more details on how to create the parameter
contentCopyright © 2004–2017 XWiki. All rights reserved.