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-withandends-withdo not support variables as their second argument.- Since:
- Mendix 7.17
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description XPathSchemaQuerysetRetrievalSchema(IRetrievalSchema schema)Adds a retrieval schema to the query.XPathQuerysetVariable(java.lang.String name, boolean value)Sets the value of the specified variable of type Boolean.XPathQuerysetVariable(java.lang.String name, double value)Sets the value of the specified variable to type Decimal.XPathQuerysetVariable(java.lang.String name, int value)Sets the value of the specified variable of type Integer.XPathQuerysetVariable(java.lang.String name, long value)Sets the value of the specified variable of type Long.XPathQuerysetVariable(java.lang.String name, IMendixIdentifier identifier)Sets the value of the specified variable of type (Mendix) Object.XPathQuerysetVariable(java.lang.String name, IMendixObject object)Sets the value of the specified variable of type (Mendix) Object.XPathQuerysetVariable(java.lang.String name, java.lang.String value)Sets the value of the specified variable of type String.XPathQuerysetVariable(java.lang.String name, java.math.BigDecimal value)Sets the value of the specified variable of type Decimal.XPathQuerysetVariable(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
XPathSchemaQuerythat 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:
setVariablein interfaceXPathBasicQuery- Specified by:
setVariablein 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:
setVariablein interfaceXPathBasicQuery- Specified by:
setVariablein 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:
setVariablein interfaceXPathBasicQuery- Specified by:
setVariablein 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:
setVariablein interfaceXPathBasicQuery- Specified by:
setVariablein 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:
setVariablein interfaceXPathBasicQuery- Specified by:
setVariablein 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:
setVariablein interfaceXPathBasicQuery- Specified by:
setVariablein 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:
setVariablein interfaceXPathBasicQuery- Specified by:
setVariablein 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:
setVariablein interfaceXPathBasicQuery- Specified by:
setVariablein 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:
setVariablein interfaceXPathQueryBase- Parameters:
name- the name of the variable to setvalues- the value to set- Returns:
- the updated query
-
-