Nuclos SaveFlags: SaveFlag.PATCH and SaveFlag.SKIP_RULES on update in rules, load attributes restricted, load version, performance. |
Language: Deutsch · English
Control saving: write individual attributes with SaveFlag.PATCH and skip update rules with SKIP_RULES.
Auf dieser Seite |
From Nuclos 4.2024.19, SaveFlags can be passed when updating a BO in rules:
| SaveFlag | Effect | since |
|---|---|---|
SaveFlag.SKIP_RULES | prevents subsequent update rules (final rules still run) | 4.2024.19 |
SaveFlag.PATCH | write individual attributes without loading all of them | 4.2024.21 |
Previously the whole record was loaded and saved:
Article article = Article.get(articleId); article.setPrice(BigDecimal.valueOf(7.99)); article.save(); |
Since 4.2023.33 records can be loaded restricted to certain attributes. When saving, the PATCH flag is then required – and the version must be loaded too:
// nur bestimmte Attribute laden (inkl. Version) und patchen Article article = Article.get(articleId, Article.Price, Article.Version); article.setPrice(BigDecimal.valueOf(7.99)); article.save(SaveFlag.PATCH, SaveFlag.SKIP_RULES); |
Also use |