Package com.mendix.datastorage
Interface XPathBasicQuery
- All Superinterfaces:
XPathQueryBase
- All Known Subinterfaces:
XPathQuery
Provides an interface to basic XPath queries.
Basic XPath queries are queries where the offset, amount, depth and sorting parameters are set directly on the interface as opposed
to using the IRetrievalSchema
interface with XPathSchemaQuery
.
-
Method Summary
Modifier and TypeMethodDescriptionAdds a sort direction.allowMathOperators
(boolean allowMathOperators) Enable or disable mathematical operators in the XPath query.setAmount
(int amount) Sets the maximum number of objects (=page size) to retrieve.setDepth
(int depth) Sets the retrieval depth of this query.setOffset
(int offset) Sets the paging offset for object retrieval.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
.Methods inherited from interface com.mendix.datastorage.XPathQueryBase
execute, executeAggregateDouble, executeAggregateLong, executeRaw, setVariable
-
Method Details
-
setAmount
Sets the maximum number of objects (=page size) to retrieve. If not set, the default is -1, which means that the amount is unlimited.- Parameters:
amount
- the maximum number of objects- Returns:
- the updated query instance
-
setOffset
Sets the paging offset for object retrieval. If not set, the default is -1, which means that no offset is applied.- Parameters:
offset
- the index of the first object to retrieve- Returns:
- the updated query instance
-
addSort
Adds a sort direction. This affects the sort of the objects that are retrieved. When multiple sorts are added each subsequent sort objects that are equal according to the earlier values- Parameters:
attribute
- the attribute on which should be sortedascending
- the direction of the sort. If this value is true it sorts from the smallest value to the largest. If it is false it sorts from the largest value to the smallest.- Returns:
- the updated query instance
-
setDepth
Sets the retrieval depth of this query. It determines until which level IMendixIdentifiers are resolved to IMendixObjects. If not set, the default is 0, which means that ids of associated objects are retrieved, but not the associated objects themselves.- Parameters:
depth
- the retrieval depth- Returns:
- the updated query instance
-
setVariable
Sets a variable with a value of typeBigDecimal
.- Specified by:
setVariable
in interfaceXPathQueryBase
- 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
.- Specified by:
setVariable
in interfaceXPathQueryBase
- 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
.- Specified by:
setVariable
in interfaceXPathQueryBase
- 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
.- Specified by:
setVariable
in interfaceXPathQueryBase
- 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
.- Specified by:
setVariable
in interfaceXPathQueryBase
- 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
.- Specified by:
setVariable
in interfaceXPathQueryBase
- 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
.- Specified by:
setVariable
in interfaceXPathQueryBase
- 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
.- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of the variable referenced in the expression (without '$')value
- the value of the variable- Returns:
- the updated query instance
-
allowMathOperators
Enable or disable mathematical operators in the XPath query. By default, mathematical operators are not allowed.- Specified by:
allowMathOperators
in interfaceXPathQueryBase
- Parameters:
allowMathOperators
- sets whether mathematical operators should be allowed in the XPath query- Returns:
- the updated query instance
-