Skip to content

Commit b00bd9a

Browse files
committed
CAY-2896 Inserting two identical objects into two datamaps stores both objects in the last used datamap
- release notes and minor cleaup
1 parent 9e2c5c4 commit b00bd9a

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

RELEASE-NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Bug Fixes:
2020

2121
CAY-2883 License and notice templates are not processed by the Gradle build
2222
CAY-2885 Modeler: DbImport fails to load DB schema view
23+
CAY-2896 Inserting two identical objects into two datamaps stores both objects in the last used datamap
2324

2425
----------------------------------
2526
Release: 4.2.2

cayenne-server/src/main/java/org/apache/cayenne/access/flush/operation/BaseDbRowOp.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,13 @@ public String toString() {
7777
return entity.getName() + " " + changeId;
7878
}
7979

80+
/**
81+
* Internal check used in the batching ops logic
82+
* @param rowOp to compare with
83+
* @return true if another op has the same entity name and datamap
84+
*/
8085
protected boolean entitiesHaveSameNameAndDataMap(DbRowOp rowOp) {
81-
return entitiesHaveSameName(rowOp) && entitiesHaveSameDataMap(rowOp);
82-
}
83-
84-
boolean entitiesHaveSameName(DbRowOp rowOp) {
85-
return rowOp.getEntity().getName().equals(getEntity().getName());
86-
}
87-
88-
private boolean entitiesHaveSameDataMap(DbRowOp rowOp) {
89-
return rowOp.getEntity().getDataMap().getName().equals(getEntity().getDataMap().getName());
86+
return getEntity().getName().equals(rowOp.getEntity().getName())
87+
&& getEntity().getDataMap().getName().equals(rowOp.getEntity().getDataMap().getName());
9088
}
9189
}

0 commit comments

Comments
 (0)