Repository: cayenne
Updated Branches:
  refs/heads/master 5d23f9b5d -> ea750528a


CAY-2049 | Changing the Relationship name in ObjRelationship Inspector has no 
effect


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

Branch: refs/heads/master
Commit: c07db4b3486a53bb03a84dc7f9df10dea85b2376
Parents: 5d23f9b
Author: Savva Kolbachev <[email protected]>
Authored: Tue Jan 19 18:23:38 2016 +0300
Committer: Savva Kolbachev <[email protected]>
Committed: Tue Jan 19 18:23:38 2016 +0300

----------------------------------------------------------------------
 docs/doc/src/main/resources/RELEASE-NOTES.txt             |  1 +
 .../modeler/dialog/objentity/ObjRelationshipInfo.java     | 10 ++++------
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/c07db4b3/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt 
b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index ea13a79..9814b36 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -54,6 +54,7 @@ CAY-2003 cdbimport doesn't work properly with several 
includeTable tags
 CAY-2015 Joint prefetches combined with DisjointById prefetches return null 
incorrectly
 CAY-2020 typo: correction to upper alpha range in Rot13PasswordEncoder
 CAY-2041 "cayenne.jdbc.max_connections" and "cayenne.jdbc.min_connections" 
command line options are ignored
+CAY-2049 Changing the Relationship name in ObjRelationship Inspector has no 
effect
 
 ----------------------------------
 Release: 4.0.M2

http://git-wip-us.apache.org/repos/asf/cayenne/blob/c07db4b3/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfo.java
----------------------------------------------------------------------
diff --git 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfo.java
 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfo.java
index d7b0317..445f512 100644
--- 
a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfo.java
+++ 
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjRelationshipInfo.java
@@ -72,7 +72,6 @@ public class ObjRelationshipInfo extends CayenneController 
implements TreeSelect
     protected List<ObjEntity> objectTargets;
     protected List<String> targetCollections;
     protected List<String> mapKeys;
-    protected String relationshipName;
     protected String targetCollection;
     protected String mapKey;
     protected ObjRelationshipInfoView view;
@@ -100,8 +99,7 @@ public class ObjRelationshipInfo extends CayenneController 
implements TreeSelect
         setObjectTarget(target);
         
view.sourceEntityLabel.setText(relationship.getSourceEntity().getName());
         this.relationship = relationship;
-        this.relationshipName = relationship.getName();
-        view.relationshipName.setText(relationshipName);
+        this.view.getRelationshipName().setText(relationship.getName());
         this.mapKey = relationship.getMapKey();
         this.targetCollection = relationship.getCollectionType();
         if (targetCollection == null) {
@@ -522,12 +520,11 @@ public class ObjRelationshipInfo extends 
CayenneController implements TreeSelect
     }
 
     public String getRelationshipName() {
-        return relationshipName;
+        return view.getRelationshipName().getText();
     }
 
     public void setRelationshipName(String relationshipName) {
-        view.relationshipName.setText(relationshipName);
-        this.relationshipName = relationshipName;
+        view.getRelationshipName().setText(relationshipName);
     }
 
     /**
@@ -563,6 +560,7 @@ public class ObjRelationshipInfo extends CayenneController 
implements TreeSelect
 
         boolean oldToMany = relationship.isToMany();
 
+        String relationshipName = getRelationshipName();
         if (!Util.nullSafeEquals(relationship.getName(), relationshipName)) {
             hasChanges = true;
             relationship.setName(relationshipName);

Reply via email to