From 69395adba81686b42c2333ecf7d4ff4b3067101a Mon Sep 17 00:00:00 2001 From: Gerrit Meier Date: Fri, 14 Oct 2022 11:05:39 +0200 Subject: [PATCH] Add section about projection modification after loading. --- src/main/asciidoc/object-mapping/projections.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/asciidoc/object-mapping/projections.adoc b/src/main/asciidoc/object-mapping/projections.adoc index 83882591d..5b363cd17 100644 --- a/src/main/asciidoc/object-mapping/projections.adoc +++ b/src/main/asciidoc/object-mapping/projections.adoc @@ -62,6 +62,14 @@ the projection logic will not follow those cycles but only create cycle-free que Multi-level projections are bounded to the entities they should project. `RelationshipProperties` fall into the category of entities in this case and needs to get respected if projections get applied. +[[projections.sdn.manipulation]] +== Data manipulation of projections + +If you have fetched the projection as a DTO, you can modify its values. +But in case you are using the interface-based projection, you cannot just update the interface. +A typical pattern that can be used is to provide a method in your domain entity class that consumes the interface and creates a domain entity with the copied values from the interface. +This way, you can then update the entity and persist it again with the projection blueprint/mask as described in the next section. + [[projections.sdn.persistence]] == Persistence of projections