public interface Query
Note that it was modeled after the JCR Query interface.
| Modifier and Type | Field and Description |
|---|---|
static String |
HQL
Indicator for Hibernate Query Language.
|
static String |
XPATH
Indicator for XPath language.
|
static String |
XWQL
Indicator for XWiki Query Language.
|
| Modifier and Type | Method and Description |
|---|---|
Query |
addFilter(QueryFilter filter) |
Query |
bindValue(int index,
Object val)
Bind a positional parameter present in the statement (?index in XWQL) with a value.
|
Query |
bindValue(String var,
Object val)
Bind named parameter var with value val in query statement.
|
Query |
bindValues(List<Object> values)
Bind a list of positional parameters values.
|
<T> List<T> |
execute() |
List<QueryFilter> |
getFilters() |
String |
getLanguage() |
int |
getLimit() |
Map<String,Object> |
getNamedParameters() |
int |
getOffset() |
Map<Integer,Object> |
getPositionalParameters() |
String |
getStatement() |
String |
getWiki() |
boolean |
isNamed()
if the query is named, then
getStatement() returns a name of the query, else - a query statement. |
Query |
setLimit(int limit) |
Query |
setOffset(int offset) |
Query |
setWiki(String wiki) |
static final String HQL
static final String XPATH
static final String XWQL
boolean isNamed()
getStatement() returns a name of the query, else - a query statement.Query setWiki(String wiki)
wiki - virtual wiki to run the query. null is a current wiki.String getWiki()
setWiki(String)Query bindValue(String var, Object val)
var - variable in query statement (:var).val - value of the variable.Query bindValue(int index, Object val)
bindValue(String, Object).index - index of positional parameter. Index starting number depends on the query language. According to the
JPQL standard index should start from 1.val - value of the variable.Query bindValues(List<Object> values)
bindValue(int, Object).values - list of positional parameters values.bindValue(int, Object)Map<String,Object> getNamedParameters()
bindValue(String, Object)Map<Integer,Object> getPositionalParameters()
bindValue(int, Object)Query addFilter(QueryFilter filter)
filter - the QueryFilter to add to this query.List<QueryFilter> getFilters()
QueryFilters that will be applied to this query.Query setLimit(int limit)
limit - limit of result list to set (so execute().size() will be <= limit).Query setOffset(int offset)
offset - offset of query result to set (skip first "offset" rows).int getLimit()
setLimit(int)int getOffset()
setOffset(int)<T> List<T> execute() throws QueryException
T - expected type of elements in the result list.QueryException - if something goes wrong.Copyright © 2004–2015 XWiki. All rights reserved.