Skip to content

Commit af88581

Browse files
authored
Merge pull request #10270 from mendix/MvM-Can-UPDATEAssociations
Add Associations to OQL Statements
2 parents a792867 + 55c9b43 commit af88581

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ aliases:
1111

1212
## Introduction
1313

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.
1714

1815
OQL statements are translated to SQL statements that are sent to the database.
1916
This can be much faster than retrieving the objects in a microflow and then updating or deleting the resulting list.
2017

2118
This feature is experimental and currently only accessible through the Java API by writing a Java action.
2219

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+
2329
## Java API for OQL updates
2430

2531
OQL Statements can be executed using the `Core.createOqlStatement` Java API. For example:
@@ -87,9 +93,14 @@ SET
8793
Name = UPPER(Name)
8894
```
8995

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+
90102
### OQL `UPDATE` Limitations
91103

92-
* At the moment, it is only possible to update attributes, not associations.
93104
* 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.
94105
* 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.
95106
* The general limitations for OQL statements also apply. See [General Limitations for OQL Statements](#oql-limitations), below.

0 commit comments

Comments
 (0)