You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2020/10/03 07:39:42 UTC

[cayenne] branch STABLE-4.1 updated (bb0bda0 -> 4073c13)

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

aadamchik pushed a change to branch STABLE-4.1
in repository https://gitbox.apache.org/repos/asf/cayenne.git.


    from bb0bda0  CAY-2682 Vertical Inheritance: DB-generated PK doesn't propagate from the root to children
     new 9afbfd9  CAY-2682 Vertical Inheritance: DB-generated PK doesn't propagate from the root to children
     new 4073c13  CAY-2682 Vertical Inheritance: DB-generated PK doesn't propagate from the root to children

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 RELEASE-NOTES.txt                                                      | 1 -
 .../main/java/org/apache/cayenne/access/DataDomainDBDiffBuilder.java   | 2 +-
 .../main/java/org/apache/cayenne/access/DataDomainInsertBucket.java    | 3 ---
 .../src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java | 2 ++
 4 files changed, 3 insertions(+), 5 deletions(-)


[cayenne] 02/02: CAY-2682 Vertical Inheritance: DB-generated PK doesn't propagate from the root to children

Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aadamchik pushed a commit to branch STABLE-4.1
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 4073c134f7c9415773f5511d74aebfe451cfb0f6
Author: Andrus Adamchik <an...@objectstyle.com>
AuthorDate: Sat Oct 3 10:34:33 2020 +0300

    CAY-2682 Vertical Inheritance: DB-generated PK doesn't propagate from the root to children
    
    * marking the test as ignored
---
 .../src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java b/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java
index 5ae52ab..8d9f1b7 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/VerticalInheritanceIT.java
@@ -33,6 +33,7 @@ import org.apache.cayenne.unit.di.server.CayenneProjects;
 import org.apache.cayenne.unit.di.server.ServerCase;
 import org.apache.cayenne.unit.di.server.UseServerRuntime;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import java.sql.SQLException;
@@ -679,6 +680,7 @@ public class VerticalInheritanceIT extends ServerCase {
 	}
 
 	@Test
+	@Ignore("CAY-2682. Fixed in 4.2 as the FlushAction is reimplemented")
 	public void testPropagatedGeneratedPK() {
 		IvGenKeySub sub = context.newObject(IvGenKeySub.class);
 		sub.setName("test");


[cayenne] 01/02: CAY-2682 Vertical Inheritance: DB-generated PK doesn't propagate from the root to children

Posted by aa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aadamchik pushed a commit to branch STABLE-4.1
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 9afbfd99c0fca97fc21d3b84bca2e1f7253c248b
Author: Andrus Adamchik <an...@objectstyle.com>
AuthorDate: Sat Oct 3 10:34:33 2020 +0300

    CAY-2682 Vertical Inheritance: DB-generated PK doesn't propagate from the root to children
    
    * unrolling the previous PR. It causes some issues in our tests
    * keeping the tests
---
 RELEASE-NOTES.txt                                                      | 1 -
 .../main/java/org/apache/cayenne/access/DataDomainDBDiffBuilder.java   | 2 +-
 .../main/java/org/apache/cayenne/access/DataDomainInsertBucket.java    | 3 ---
 3 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index ad24b4f..9542257 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -17,7 +17,6 @@ Bug Fixes:
 CAY-2670 CommitLog does not include FKs for deleted objects with one-way relationships
 CAY-2679 Unstable ordering of relationships in the .map.xml file
 CAY-2681 Modeler: All selected checkboxes cause project to become dirty at initialization
-CAY-2682 Vertical Inheritance: DB-generated PK doesn't propagate from the root to children
 
 ----------------------------------
 Release: 4.1
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainDBDiffBuilder.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainDBDiffBuilder.java
index 507a752..373334f 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainDBDiffBuilder.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainDBDiffBuilder.java
@@ -86,8 +86,8 @@ class DataDomainDBDiffBuilder implements GraphChangeHandler {
         Map<String, Object> dbDiff = new HashMap<>();
 
         appendSimpleProperties(dbDiff);
-        appendPrimaryKeys(dbDiff);
         appendForeignKeys(dbDiff);
+        appendPrimaryKeys(dbDiff);
 
         return dbDiff.isEmpty() ? null : dbDiff;
     }
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java
index 89b1857..e2b8500 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataDomainInsertBucket.java
@@ -154,9 +154,6 @@ class DataDomainInsertBucket extends DataDomainSyncBucket {
 
                 // skip propagated
                 if (isPropagated(dbAttr)) {
-                    // this covers rare case of the DB-generated flattened PK,
-                    // for normal propagated PK this will be overwritten by the arc diff later
-                    idMap.put(dbAttrName, new PropagatedValueFactory(id, dbAttrName));
                     continue;
                 }