public interface XPathQuery extends XPathQueryBase, XPathBasicQuery
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.
Modifier and Type | Method and Description |
---|---|
XPathSchemaQuery |
setRetrievalSchema(IRetrievalSchema schema)
Adds a retrieval schema to the query
|
XPathQuery |
setVariable(java.lang.String name,
java.math.BigDecimal value)
Sets a variable with a value of type
BigDecimal
Adds a BigDecimal variable
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. |
XPathQuery |
setVariable(java.lang.String name,
boolean value)
Sets a variable with a value of type
Boolean
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. |
XPathQuery |
setVariable(java.lang.String name,
double value)
Sets a variable with a value of type
Double
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. |
XPathQuery |
setVariable(java.lang.String name,
IMendixIdentifier identifier)
Sets a variable with a value of type
IMendixIdentifier
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. |
XPathQuery |
setVariable(java.lang.String name,
IMendixObject object)
Sets a variable with a value of type
IMendixObject
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. |
XPathQuery |
setVariable(java.lang.String name,
int value)
Sets a variable with a value of type
Integer
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. |
XPathQuery |
setVariable(java.lang.String name,
long value)
Sets a variable with a value of type
Long
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. |
XPathQuery |
setVariable(java.lang.String name,
java.lang.String value)
Sets a variable with a value of type
String
In XPath queries it is possible to add variables Variable can be denoted with '$', e.g. |
addSort, setAmount, setDepth, setOffset
execute
XPathSchemaQuery setRetrievalSchema(IRetrievalSchema schema)
schema
- the schema to apply.XPathSchemaQuery
that can be use to construct an XPath query
with schemaXPathQuery setVariable(java.lang.String name, java.math.BigDecimal value)
XPathQueryBase
BigDecimal
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]'.setVariable
in interface XPathBasicQuery
setVariable
in interface XPathQueryBase
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literal BigDecimal
valueXPathQuery
that can be use to construct an XPath queryXPathQuery setVariable(java.lang.String name, boolean value)
XPathQueryBase
Boolean
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]'.setVariable
in interface XPathBasicQuery
setVariable
in interface XPathQueryBase
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literal Boolean
valueXPathQuery
that can be use to construct an XPath queryXPathQuery setVariable(java.lang.String name, double value)
XPathQueryBase
Double
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]'.setVariable
in interface XPathBasicQuery
setVariable
in interface XPathQueryBase
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literal Double
valueXPathQuery
that can be use to construct an XPath queryXPathQuery setVariable(java.lang.String name, int value)
XPathQueryBase
Integer
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]'.setVariable
in interface XPathBasicQuery
setVariable
in interface XPathQueryBase
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literal Integer
valueXPathQuery
that can be use to construct an XPath queryXPathQuery setVariable(java.lang.String name, long value)
XPathQueryBase
Long
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]'.setVariable
in interface XPathBasicQuery
setVariable
in interface XPathQueryBase
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literal Long
valueXPathQuery
that can be use to construct an XPath queryXPathQuery setVariable(java.lang.String name, IMendixObject object)
XPathQueryBase
IMendixObject
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]'.setVariable
in interface XPathBasicQuery
setVariable
in interface XPathQueryBase
name
- name of variables referenced in the expression (without '$') and their values.object
- variable that represents a IMendixObject
value. Will be replaced by it's
identifier in the queryXPathQuery
that can be use to construct an XPath queryXPathQuery setVariable(java.lang.String name, IMendixIdentifier identifier)
XPathQueryBase
IMendixIdentifier
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]'.setVariable
in interface XPathBasicQuery
setVariable
in interface XPathQueryBase
name
- name of variables referenced in the expression (without '$') and their values.identifier
- variable that represents an identifier of an objectXPathQuery
that can be use to construct an XPath queryXPathQuery setVariable(java.lang.String name, java.lang.String value)
XPathQueryBase
String
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]'.setVariable
in interface XPathBasicQuery
setVariable
in interface XPathQueryBase
name
- name of variables referenced in the expression (without '$') and their values.value
- variable that represents a literal String
valueXPathQuery
that can be use to construct an XPath query