Interface XPathQueryBase

All Known Subinterfaces:
XPathBasicQuery, XPathQuery, XPathSchemaQuery

public interface XPathQueryBase
Provides an interface to XPath queries.

This interface exists to capture the shared parts of XPathBasicQuery and XPathSchemaQuery and is usually not used directly.

In XPath queries it is possible to add variables. A variable can be denoted with '$', e.g. a valid query syntax could be //Module.Entity[field >= $limit].

  • Method Details

    • execute

      List<IMendixObject> execute(IContext context)
      Retrieves object list using the given context (synchronously).
      Parameters:
      context - the context to be used to process this request
      Returns:
      the list of retrieved objects
    • executeRaw

      IDataTable executeRaw(IContext context)
      Retrieves data table using the given context (synchronously).
      Parameters:
      context - the context to be used to process this request
      Returns:
      the data table containing the raw data
    • executeAggregateLong

      Long executeAggregateLong(IContext context)
      Retrieves long aggregate value based on the given query (root element of the query should be an aggregate function, e.g. "COUNT(//System.User)") (synchronously).
      Parameters:
      context - context to be used to process this request
      Returns:
      the aggregate value
    • executeAggregateDouble

      Double executeAggregateDouble(IContext context)
      Retrieves double aggregate value based on the given query (root element of the query should be an aggregate function, e.g. "COUNT(//System.User)") (synchronously).
      Parameters:
      context - context to be used to process this request
      Returns:
      the aggregate value
    • setVariable

      XPathQueryBase setVariable(String name, BigDecimal value)
      Sets a variable with a value of type BigDecimal.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      value - the value of the variable
      Returns:
      the updated query instance
    • setVariable

      XPathQueryBase setVariable(String name, boolean value)
      Sets a variable with a value of type boolean.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      value - the value of the variable
      Returns:
      the updated query instance
    • setVariable

      XPathQueryBase setVariable(String name, double value)
      Sets a variable with a value of type double.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      value - the value of the variable
      Returns:
      the updated query instance
    • setVariable

      XPathQueryBase setVariable(String name, int value)
      Sets a variable with a value of type int.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      value - the value of the variable
      Returns:
      the updated query instance
    • setVariable

      XPathQueryBase setVariable(String name, long value)
      Sets a variable with a value of type long.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      value - the value of the variable
      Returns:
      the updated query instance
    • setVariable

      XPathQueryBase setVariable(String name, IMendixObject object)
      Sets a variable with a value of type IMendixObject.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      object - a IMendixObject value. Will be replaced by its IMendixIdentifier in the query.
      Returns:
      the updated query instance
    • setVariable

      XPathQueryBase setVariable(String name, IMendixIdentifier identifier)
      Sets a variable with a value of type IMendixIdentifier.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      identifier - the value of the variable
      Returns:
      the updated query instance
    • setVariable

      XPathQueryBase setVariable(String name, String value)
      Sets a variable with a value of type String.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      value - the value of the variable
      Returns:
      the updated query instance
    • setVariable

      XPathQueryBase setVariable(String name, Collection<?> values)
      Sets a variable with a value of type Collection.
      Parameters:
      name - name of the variable referenced in the expression (without '$')
      values - the value of the variable as a collection
      Returns:
      the updated query instance
    • allowMathOperators

      XPathQueryBase allowMathOperators(boolean allowMathOperators)
      Enable or disable mathematical operators in the XPath query. By default, mathematical operators are not allowed.
      Parameters:
      allowMathOperators - sets whether mathematical operators should be allowed in the XPath query
      Returns:
      the updated query instance