cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnth...@apache.org
Subject [2/6] cayenne git commit: Fix flattened attributes
Date Tue, 09 Aug 2016 16:30:31 GMT
Fix flattened attributes


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/b93a51c6
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/b93a51c6
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/b93a51c6

Branch: refs/heads/ics11
Commit: b93a51c61ee491b9d9e188dadc0d6606f264a28b
Parents: 34bdd84
Author: John Huss <johnthuss@apache.org>
Authored: Fri Jan 31 17:00:47 2014 -0600
Committer: John Huss <johnthuss@apache.org>
Committed: Wed Jun 24 11:40:12 2015 -0500

----------------------------------------------------------------------
 .../cayenne/access/DataNodeSyncQualifierDescriptor.java      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/b93a51c6/cayenne-server/src/main/java/org/apache/cayenne/access/DataNodeSyncQualifierDescriptor.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DataNodeSyncQualifierDescriptor.java
b/cayenne-server/src/main/java/org/apache/cayenne/access/DataNodeSyncQualifierDescriptor.java
index 4d037ac..9f117da 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DataNodeSyncQualifierDescriptor.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DataNodeSyncQualifierDescriptor.java
@@ -109,7 +109,7 @@ class DataNodeSyncQualifierDescriptor {
 
                             public Object transform(Object input) {
                                 ObjectId id = (ObjectId) ((ObjectDiff) input).getNodeId();
-                                return id.getIdSnapshot().get(dbAttrPair.getSourceName());
+                                return id.getIdSnapshot().get(dbAttrPair.getTargetName());
                             }
                         });
                     }
@@ -117,16 +117,16 @@ class DataNodeSyncQualifierDescriptor {
             }
         }
 
-        if (usingOptimisticLocking) {
+        if (descriptor.isMaster() && usingOptimisticLocking) {
 
             for (final ObjAttribute attribute : descriptor.getEntity().getAttributes()) {
 
-                if (attribute.isUsedForLocking()) {
+                if (attribute.isUsedForLocking() && !attribute.isFlattened()) {
                     // only care about first step in a flattened attribute
                     DbAttribute dbAttribute = (DbAttribute) attribute
                             .getDbPathIterator()
                             .next();
-
+                    
                     if (!attributes.contains(dbAttribute)) {
                         attributes.add(dbAttribute);
 


Mime
View raw message