Mendix 7 is no longer supported unless you have Extended Support (for details, please contact Mendix Support). Mendix 7 documentation will remain available for customers with Extended Support until July, 2024.
XPath Expressions
1 Overview
Expressions are used within constraints to generate a value that is true.
There are three types of expressions usable for constraints:
- Comparisons with operators
- Functions
- Exist-expressions
2 Comparisons
A comparison expression consists of two attributes or values separated by a comparison operator like =
, <=,
and >
.
2.1 Examples
For example, this query retrieves all customers whose name is “Jansen”:
|
|
This query retrieves all the orders for which the total price is less than 50.00 euros:
|
|
This query retrieves all customers who have at least one unpaid order:
|
|
This query retrieves all the customers who have the same name as the city they live in:
|
|
This query retrieves the customer who placed the order with the given unique identification number:
|
|
The same result can be retrieved by doing the following query:
|
|
However, it is strongly recommended not to use the notation above. This is because its execution is inefficient and will result in a lower performance due to the manner in which it is processed by the database.
3 Functions
For information on the available functions, see XPath Constraint Functions.
4 Exist-Expressions
The last type of expression is the exist-expression, which can be used to check whether a specific association is filled or not.
4.1 Examples
This query retrieves all the customers who have placed at least one order:
|
|
This query retrieves all the customers who have not placed any orders:
|
|