You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/refguide/modeling/domain-model/oql/oql-statements.md
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,15 +11,21 @@ aliases:
11
11
12
12
## Introduction
13
13
14
-
From Mendix version 11.1, you can delete objects in bulk using OQL `DELETE` statements.
15
-
16
-
From Mendix version 11.3, you can also update object attributes in bulk using OQL `UPDATE` statements.
17
14
18
15
OQL statements are translated to SQL statements that are sent to the database.
19
16
This can be much faster than retrieving the objects in a microflow and then updating or deleting the resulting list.
20
17
21
18
This feature is experimental and currently only accessible through the Java API by writing a Java action.
22
19
20
+
{{% alert color="info" %}}
21
+
From Mendix version 11.1, you can delete objects in bulk using OQL `DELETE` statements.
22
+
23
+
From Mendix version 11.3, you can also update object attributes in bulk using OQL `UPDATE` statements.
24
+
25
+
From Mendix version 11.4, you can update object associations as well as attributes in bulk using OQL `UPDATE` statements.
26
+
27
+
{{% /alert %}}
28
+
23
29
## Java API for OQL updates
24
30
25
31
OQL Statements can be executed using the `Core.createOqlStatement` Java API. For example:
@@ -87,9 +93,14 @@ SET
87
93
Name =UPPER(Name)
88
94
```
89
95
96
+
{{% alert color="info" %}}
97
+
Updating attributes was introduced in Mendix 11.3.
98
+
99
+
Updating associations was added in Mendix 11.4.
100
+
{{% /alert %}}
101
+
90
102
### OQL `UPDATE` Limitations
91
103
92
-
* At the moment, it is only possible to update attributes, not associations.
93
104
* If a subquery or a long path over a many-to-one or many-to-many association is used as `expression`, it can result in multiple values. In that case, a database-level exception will occur when running the statement.
94
105
* In the case of inheritance, it is not possible to simultaneously update an attribute and use that attribute in an expression to update an attribute on another inheritance level. See the example in [Mixed Attribute Update](#inheritance), below.
95
106
* The general limitations for OQL statements also apply. See [General Limitations for OQL Statements](#oql-limitations), below.
0 commit comments