cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [2/3] cayenne git commit: CAY-2281 ObjEntity attribute overrides are never deleted
Date Wed, 19 Apr 2017 15:22:52 GMT
CAY-2281 ObjEntity attribute overrides are never deleted


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

Branch: refs/heads/master
Commit: a60b88f88c768f920e9440b009c0df7f45b6b4e2
Parents: 3d55765
Author: Anton Dreka <drekoas@gmail.com>
Authored: Wed Apr 19 16:31:03 2017 +0300
Committer: Anton Dreka <drekoas@gmail.com>
Committed: Wed Apr 19 16:31:03 2017 +0300

----------------------------------------------------------------------
 .../cayenne/modeler/editor/ObjEntityAttributePanel.java   | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/a60b88f8/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
index 13c7361..f50143b 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
@@ -48,6 +48,7 @@ import org.apache.cayenne.modeler.util.DbAttributePathComboBoxRenderer;
 import org.apache.cayenne.modeler.util.DbAttributePathComboBoxEditor;
 import org.apache.cayenne.modeler.util.ModelerUtil;
 import org.apache.cayenne.modeler.util.PanelFactory;
+import org.apache.cayenne.modeler.util.ProjectUtil;
 import org.apache.cayenne.modeler.util.UIUtil;
 import org.apache.cayenne.modeler.util.combo.AutoCompletion;
 
@@ -296,13 +297,8 @@ public class ObjEntityAttributePanel extends JPanel implements ObjEntityDisplayL
     }
 
     public void removeDuplicateAttribute(AttributeEvent e) {
-        ObjEntity current = (ObjEntity) e.getEntity();
-        Collection<ObjEntity> objEntities = new ArrayList<>();
-        for (ObjEntity objEntity: e.getEntity().getDataMap().getObjEntities()) {
-            if (objEntity.isSubentityOf(current)) {
-                objEntities.add(objEntity);
-            }
-        }
+        Collection<ObjEntity> objEntities = ProjectUtil.getCollectionOfChildren((ObjEntity)
e.getEntity());
+
 
         for (ObjEntity objEntity: objEntities) {
             if (objEntity.getDeclaredAttribute(e.getAttribute().getName()) != null) {


Mime
View raw message