Package com.mendix.datastorage
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.XPath string functions
contains
,starts-with
andends-with
do not support variables as their second argument.- 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 the value of the specified variable of type Boolean.XPathQuery
setVariable(java.lang.String name, double value)
Sets the value of the specified variable to type Decimal.XPathQuery
setVariable(java.lang.String name, int value)
Sets the value of the specified variable of type Integer.XPathQuery
setVariable(java.lang.String name, long value)
Sets the value of the specified variable of type Long.XPathQuery
setVariable(java.lang.String name, IMendixIdentifier identifier)
Sets the value of the specified variable of type (Mendix) Object.XPathQuery
setVariable(java.lang.String name, IMendixObject object)
Sets the value of the specified variable of type (Mendix) Object.XPathQuery
setVariable(java.lang.String name, java.lang.String value)
Sets the value of the specified variable of type String.XPathQuery
setVariable(java.lang.String name, java.math.BigDecimal value)
Sets the value of the specified variable of type Decimal.XPathQuery
setVariable(java.lang.String name, java.util.Collection<?> values)
Sets the value of the specified variable of type List.-
Methods inherited from interface com.mendix.datastorage.XPathBasicQuery
addSort, setAmount, setDepth, setOffset
-
Methods inherited from interface com.mendix.datastorage.XPathQueryBase
execute, executeAggregateDouble, executeAggregateLong, executeRaw
-
-
-
-
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 used to construct an XPath query with schema
-
setVariable
XPathQuery setVariable(java.lang.String name, java.math.BigDecimal value)
Sets the value of the specified variable of type Decimal.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setvalue
- the value to set- Returns:
- the updated query
-
setVariable
XPathQuery setVariable(java.lang.String name, boolean value)
Sets the value of the specified variable of type Boolean.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setvalue
- the value to set- Returns:
- the updated query
-
setVariable
XPathQuery setVariable(java.lang.String name, double value)
Sets the value of the specified variable to type Decimal.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setvalue
- the value to set- Returns:
- the updated query
-
setVariable
XPathQuery setVariable(java.lang.String name, int value)
Sets the value of the specified variable of type Integer.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setvalue
- the value to set- Returns:
- the updated query
-
setVariable
XPathQuery setVariable(java.lang.String name, long value)
Sets the value of the specified variable of type Long.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setvalue
- the value to set- Returns:
- the updated query
-
setVariable
XPathQuery setVariable(java.lang.String name, IMendixObject object)
Sets the value of the specified variable of type (Mendix) Object.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setobject
- the value to set- Returns:
- the updated query
-
setVariable
XPathQuery setVariable(java.lang.String name, IMendixIdentifier identifier)
Sets the value of the specified variable of type (Mendix) Object.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setidentifier
- the value to set- Returns:
- the updated query
-
setVariable
XPathQuery setVariable(java.lang.String name, java.lang.String value)
Sets the value of the specified variable of type String.- Specified by:
setVariable
in interfaceXPathBasicQuery
- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setvalue
- the value to set- Returns:
- the updated query
-
setVariable
XPathQuery setVariable(java.lang.String name, java.util.Collection<?> values)
Sets the value of the specified variable of type List.- Specified by:
setVariable
in interfaceXPathQueryBase
- Parameters:
name
- the name of the variable to setvalues
- the value to set- Returns:
- the updated query
-
-