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 910554084 CAY-2896 Inserting two identical objects into two datamaps 
stores both objects in the last used datamap  - release notes and minor cleaup
910554084 is described below

commit 91055408430e680b1e7e172470693bf8f441bbc0
Author: Nikita Timofeev <[email protected]>
AuthorDate: Wed Sep 24 18:15:51 2025 +0400

    CAY-2896 Inserting two identical objects into two datamaps stores both 
objects in the last used datamap
     - release notes and minor cleaup
---
 RELEASE-NOTES.txt                                        |  1 +
 .../cayenne/access/flush/operation/BaseDbRowOp.java      | 16 +++++++---------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index b6146461c..32f57281b 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -27,6 +27,7 @@ CAY-2876 Memory leak in the ObjectStore
 CAY-2879 Negative number for non parameterized ObjectSelect query not 
processed correctly
 CAY-2883 License and notice templates are not processed by the Gradle build
 CAY-2885 Modeler: DbImport fails to load DB schema view
+CAY-2896 Inserting two identical objects into two datamaps stores both objects 
in the last used datamap
 
 ----------------------------------
 Release: 5.0-M1
diff --git 
a/cayenne/src/main/java/org/apache/cayenne/access/flush/operation/BaseDbRowOp.java
 
b/cayenne/src/main/java/org/apache/cayenne/access/flush/operation/BaseDbRowOp.java
index e5c40198e..2eedfe9e6 100644
--- 
a/cayenne/src/main/java/org/apache/cayenne/access/flush/operation/BaseDbRowOp.java
+++ 
b/cayenne/src/main/java/org/apache/cayenne/access/flush/operation/BaseDbRowOp.java
@@ -77,15 +77,13 @@ public abstract class BaseDbRowOp implements DbRowOp {
         return entity.getName() + " " + changeId;
     }
 
+    /**
+     * Internal check used in the batching ops logic
+     * @param rowOp to compare with
+     * @return true if another op has the same entity name and datamap
+     */
     protected boolean entitiesHaveSameNameAndDataMap(DbRowOp rowOp) {
-        return entitiesHaveSameName(rowOp) && entitiesHaveSameDataMap(rowOp);
-    }
-
-    boolean entitiesHaveSameName(DbRowOp rowOp) {
-        return rowOp.getEntity().getName().equals(getEntity().getName());
-    }
-
-    private boolean entitiesHaveSameDataMap(DbRowOp rowOp) {
-        return 
rowOp.getEntity().getDataMap().getName().equals(getEntity().getDataMap().getName());
+        return getEntity().getName().equals(rowOp.getEntity().getName())
+                && 
getEntity().getDataMap().getName().equals(rowOp.getEntity().getDataMap().getName());
     }
 }

Reply via email to