This is an automated email from the ASF dual-hosted git repository.

ntimofeev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git


The following commit(s) were added to refs/heads/master by this push:
     new e7322b4  Resolve values eagerly in EffectiveOpId
e7322b4 is described below

commit e7322b460c5984e149b1072a44cf07780a73e901
Author: Nikita Timofeev <[email protected]>
AuthorDate: Wed Nov 13 18:01:27 2019 +0300

    Resolve values eagerly in EffectiveOpId
---
 .../main/java/org/apache/cayenne/access/flush/EffectiveOpId.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/access/flush/EffectiveOpId.java
 
b/cayenne-server/src/main/java/org/apache/cayenne/access/flush/EffectiveOpId.java
index 8a94793..f61b35e 100644
--- 
a/cayenne-server/src/main/java/org/apache/cayenne/access/flush/EffectiveOpId.java
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/access/flush/EffectiveOpId.java
@@ -19,7 +19,9 @@
 
 package org.apache.cayenne.access.flush;
 
+import java.util.HashMap;
 import java.util.Map;
+import java.util.function.Supplier;
 
 import org.apache.cayenne.ObjectId;
 
@@ -38,7 +40,12 @@ public class EffectiveOpId {
     public EffectiveOpId(ObjectId id) {
         this.id = id;
         this.entityName = id.getEntityName();
-        this.snapshot = id.getIdSnapshot();
+        this.snapshot = new HashMap<>(id.getIdSnapshot());
+        this.snapshot.entrySet().forEach(entry -> {
+            if(entry.getValue() instanceof Supplier) {
+                entry.setValue(((Supplier) entry.getValue()).get());
+            }
+        });
     }
 
     @Override

Reply via email to