Interface XPathQuery
-
- All Superinterfaces:
XPathBasicQuery
,XPathQueryBase
public interface XPathQuery extends XPathQueryBase, XPathBasicQuery
Fluent API for basic or schema-based XPath queries.Can be used to create and execute XPath queries in a fluent manner. For example:
public getObjectsWithValue(IContext context, ICore core, int value) { List<IMendixObject> results = core.createXPathQuery("//Entity[attribute=$value]") .setVariable("value", 1) .setAmount(500) .setOffset(50) .setDepth(1) .execute(context); return results; }
After the XPath query is built up,
XPathQueryBase.execute(IContext)
can be called to retrieve the results.- Since:
- Mendix 7.17
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description XPathSchemaQuery
setRetrievalSchema(IRetrievalSchema schema)
Adds a retrieval schema to the query.XPathQuery
setVariable(java.lang.String name, boolean value)
Sets a variable with a value of typeBoolean
XPathQuery
setVariable(java.lang.String name, double value)
Sets a variable with a value of typeDouble
XPathQuery
setVariable(java.lang.String name, int value)
Sets a variable with a value of typeInteger
XPathQuery
setVariable(java.lang.String name, long value)
Sets a variable with a value of typeLong
XPathQuery
setVariable(java.lang.String name, IMendixIdentifier identifier)
Sets a variable with a value of typeIMendixIdentifier
XPathQuery
setVariable(java.lang.String name, IMendixObject object)
Sets a variable with a value of typeIMendixObject
XPathQuery
setVariable(java.lang.String name, java.lang.String value)
Sets a variable with a value of typeString
XPathQuery
setVariable(java.lang.String name, java.math.BigDecimal value)
Sets a variable with a value of typeBigDecimal
-
Methods inherited from interface com.mendix.datastorage.XPathBasicQuery
addSort, setAmount, setDepth, setOffset
-
Methods inherited from interface com.mendix.datastorage.XPathQueryBase
execute
-
-
-
-
Method Detail
-
setRetrievalSchema
XPathSchemaQuery setRetrievalSchema(IRetrievalSchema schema)
Adds a retrieval schema to the query.- Parameters:
schema
- the schema to apply.- Returns:
- the instance of
XPathSchemaQuery
that can be use to construct an XPath query with schema
-
setVariable
XPathQuery setVariable(java.lang.String name, java.math.BigDecimal value)
Description copied from interface:XPathQueryBase
Sets a variable with a value of typeBigDecimal
Adds a
BigDecimal
variable In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. a valid query syntax could be '//Entity.Ref[field >= $limit]'.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literalBigDecimal
value- Returns:
- the updated query instance
-
setVariable
XPathQuery setVariable(java.lang.String name, boolean value)
Description copied from interface:XPathQueryBase
Sets a variable with a value of typeBoolean
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. a valid query syntax could be '//Entity.Ref[field >= $limit]'.
- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literalBoolean
value- Returns:
- the updated query instance
-
setVariable
XPathQuery setVariable(java.lang.String name, double value)
Description copied from interface:XPathQueryBase
Sets a variable with a value of typeDouble
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. a valid query syntax could be '//Entity.Ref[field >= $limit]'.
- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literalDouble
value- Returns:
- the updated query instance
-
setVariable
XPathQuery setVariable(java.lang.String name, int value)
Description copied from interface:XPathQueryBase
Sets a variable with a value of typeInteger
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. a valid query syntax could be '//Entity.Ref[field >= $limit]'.
- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literalInteger
value- Returns:
- the updated query instance
-
setVariable
XPathQuery setVariable(java.lang.String name, long value)
Description copied from interface:XPathQueryBase
Sets a variable with a value of typeLong
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. a valid query syntax could be '//Entity.Ref[field >= $limit]'.
- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literalLong
value- Returns:
- the updated query instance
-
setVariable
XPathQuery setVariable(java.lang.String name, IMendixObject object)
Description copied from interface:XPathQueryBase
Sets a variable with a value of typeIMendixObject
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. a valid query syntax could be '//Entity.Ref[field >= $limit]'.
- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of variables referenced in the expression (without '$') and their values.object
- variable that represents aIMendixObject
value. Will be replaced by it's identifier in the query- Returns:
- the updated query instance
-
setVariable
XPathQuery setVariable(java.lang.String name, IMendixIdentifier identifier)
Description copied from interface:XPathQueryBase
Sets a variable with a value of typeIMendixIdentifier
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. a valid query syntax could be '//Entity.Ref[field >= $limit]'.
- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of variables referenced in the expression (without '$') and their values.identifier
- variable that represents an identifier of an object- Returns:
- the updated query instance
-
setVariable
XPathQuery setVariable(java.lang.String name, java.lang.String value)
Description copied from interface:XPathQueryBase
Sets a variable with a value of typeString
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. a valid query syntax could be '//Entity.Ref[field >= $limit]'.
- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literalString
value- Returns:
- the updated query instance
-
-