Package com.mendix.datastorage
Interface XPathQueryBase
- All Known Subinterfaces:
XPathBasicQuery
,XPathQuery
,XPathSchemaQuery
public interface XPathQueryBase
Provides an interface to XPath queries.
This interface exists to capture the shared parts of XPathBasicQuery
and XPathSchemaQuery
and is usually not used
directly.
In XPath queries it is possible to add variables. A variable can be denoted with '$', e.g. a valid
query syntax could be //Module.Entity[field >= $limit]
.
-
Method Summary
Modifier and TypeMethodDescriptionallowMathOperators
(boolean allowMathOperators) Enable or disable mathematical operators in the XPath query.Retrieves object list using the given context (synchronously).executeAggregateDouble
(IContext context) Retrieves double aggregate value based on the given query (root element of the query should be an aggregate function, e.g.executeAggregateLong
(IContext context) Retrieves long aggregate value based on the given query (root element of the query should be an aggregate function, e.g.executeRaw
(IContext context) Retrieves data table using the given context (synchronously).setVariable
(String name, boolean value) Sets a variable with a value of typeboolean
.setVariable
(String name, double value) Sets a variable with a value of typedouble
.setVariable
(String name, int value) Sets a variable with a value of typeint
.setVariable
(String name, long value) Sets a variable with a value of typelong
.setVariable
(String name, IMendixIdentifier identifier) Sets a variable with a value of typeIMendixIdentifier
.setVariable
(String name, IMendixObject object) Sets a variable with a value of typeIMendixObject
.setVariable
(String name, String value) Sets a variable with a value of typeString
.setVariable
(String name, BigDecimal value) Sets a variable with a value of typeBigDecimal
.setVariable
(String name, Collection<?> values) Sets a variable with a value of typeCollection
.
-
Method Details
-
execute
Retrieves object list using the given context (synchronously).- Parameters:
context
- the context to be used to process this request- Returns:
- the list of retrieved objects
-
executeRaw
Retrieves data table using the given context (synchronously).- Parameters:
context
- the context to be used to process this request- Returns:
- the data table containing the raw data
-
executeAggregateLong
Retrieves long aggregate value based on the given query (root element of the query should be an aggregate function, e.g. "COUNT(//System.User)") (synchronously).- Parameters:
context
- context to be used to process this request- Returns:
- the aggregate value
-
executeAggregateDouble
Retrieves double aggregate value based on the given query (root element of the query should be an aggregate function, e.g. "COUNT(//System.User)") (synchronously).- Parameters:
context
- context to be used to process this request- Returns:
- the aggregate value
-
setVariable
Sets a variable with a value of typeBigDecimal
.- Parameters:
name
- name of the variable referenced in the expression (without '$')value
- the value of the variable- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typeboolean
.- Parameters:
name
- name of the variable referenced in the expression (without '$')value
- the value of the variable- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typedouble
.- Parameters:
name
- name of the variable referenced in the expression (without '$')value
- the value of the variable- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typeint
.- Parameters:
name
- name of the variable referenced in the expression (without '$')value
- the value of the variable- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typelong
.- Parameters:
name
- name of the variable referenced in the expression (without '$')value
- the value of the variable- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typeIMendixObject
.- Parameters:
name
- name of the variable referenced in the expression (without '$')object
- aIMendixObject
value. Will be replaced by itsIMendixIdentifier
in the query.- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typeIMendixIdentifier
.- Parameters:
name
- name of the variable referenced in the expression (without '$')identifier
- the value of the variable- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typeString
.- Parameters:
name
- name of the variable referenced in the expression (without '$')value
- the value of the variable- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typeCollection
.- Parameters:
name
- name of the variable referenced in the expression (without '$')values
- the value of the variable as a collection- Returns:
- the updated query instance
-
allowMathOperators
Enable or disable mathematical operators in the XPath query. By default, mathematical operators are not allowed.- Parameters:
allowMathOperators
- sets whether mathematical operators should be allowed in the XPath query- Returns:
- the updated query instance
-