Skip to content

Commit ee28a82

Browse files
committed
Mention constants and enums in docs for OQL
1 parent 940e7f3 commit ee28a82

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

content/en/docs/refguide/modeling/domain-model/oql/oql-expression-syntax.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,36 @@ FROM
120120
Sales.Person
121121
```
122122

123+
## Constants {#oql-constants}
124+
125+
{{% alert color="info" %}}
126+
This feature was introduced in Mendix version 11.13.0. It is supported only in Java actions.
127+
{{% /alert %}}
128+
129+
[Constants](/refguide/constants/) can be referenced in OQL queries and statements as `$<module>.<constant_name>`. For example, if a constant `Sales.MinOrder` is defined in the module, that constant can be used in a query:
130+
131+
```sql
132+
SELECT *
133+
FROM Sales.Order
134+
WHERE Price >= $Sales.MinOrder
135+
```
136+
137+
## Enumerations {#oql-constants}
138+
139+
{{% alert color="info" %}}
140+
This feature was introduced in Mendix version 11.13.0. It is supported only in Java actions.
141+
{{% /alert %}}
142+
143+
[Enumerations](/refguide/enumerations/) can be referenced in OQL queries and statements as `<module>.<enumeration_name>#<value>`. That syntax is equivalent to using a String literal value of the enumeration, but it allows more strict control over which values are allowed.
144+
145+
For example, if an enumeration `RealEstate.PropertyTypes` has value `Apartment`, that value can be used in a query:
146+
147+
```sql
148+
SELECT *
149+
FROM RealEstate.Properties
150+
WHERE PropertyType = RealEstate.PropertyTypes#Apartment
151+
```
152+
123153
## Operators {#oql-operators}
124154

125155
Operators perform common operations and, unlike functions, do not put their parameters in parentheses. They take `expression` as input, which can be other operator results, functions, columns and literals.

0 commit comments

Comments
 (0)