Package org.xwiki.query
Interface QueryParameter
-
public interface QueryParameterRepresents a parameter of a Query. This is providing an API to represent a query parameter as made of several parts:- literal parts: those are constructed by calling
literal(String)and their characters will be escaped when the Query will executed (i.e.%,_and!characters will get escaped) - special SQL characters: constructed by calling
anyChars()andanychar()which correspond respectively to the%and_SQL characters.
#set(xwql = "WHERE doc.fullName LIKE :space AND doc.fullName <> :fullName") #set ($query = $services.query.xwql(xwql)) #set ($query = $query.bindValue('space').literal($doc.space).literal('.').anyChars().query())- Since:
- 8.4.5, 9.3RC1
- Version:
- $Id: a7b527d9f6129182107fec11b4c59d5a222b346c $
- literal parts: those are constructed by calling
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description QueryParameteranychar()Append a_character that will not be escaped.QueryParameteranyChars()Append a%character that will not be escaped.QueryParameterlike(String like)QueryParameterliteral(String literal)Queryquery()
-
-
-
Method Detail
-
literal
QueryParameter literal(String literal)
- Parameters:
literal- the characters that will get escaped at query execution time- Returns:
- this object, in order to make the API fluent
-
like
QueryParameter like(String like)
- Parameters:
like- the characters that will get executed as is (i.e no escape will be performed on them) at query execution time- Returns:
- this object, in order to make the API fluent
-
anychar
QueryParameter anychar()
Append a_character that will not be escaped.- Returns:
- this object, in order to make the API fluent
-
anyChars
QueryParameter anyChars()
Append a%character that will not be escaped.- Returns:
- this object, in order to make the API fluent
-
query
Query query()
- Returns:
- the associated query to keep the API fluent
-
-