cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1334405 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/undo/PasteUndoableEdit.java
Date Sat, 05 May 2012 11:49:38 GMT
Author: aadamchik
Date: Sat May  5 11:49:38 2012
New Revision: 1334405

URL: http://svn.apache.org/viewvc?rev=1334405&view=rev
Log:
CAY-1701 Modeler cannot undo pasting of obj (db) entity

patch by ANdrei Veprev

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/undo/PasteUndoableEdit.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=1334405&r1=1334404&r2=1334405&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Sat May  5 11:49:38 2012
@@ -73,6 +73,7 @@ CAY-1648 [PATCH] ValidationException thr
 CAY-1694 When importing an EOModel, the DataNode gets lost
 CAY-1696 Undo/Redo stop working after deleting several project items at once
 CAY-1697 Error on Save after importing database
+CAY-1701 Modeler cannot undo pasting of obj (db) entity
 CAY-1702 Excessive Selection action is generated when selecting datanode
 CAY-1703 NPE on selecting default datasource value
 

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/undo/PasteUndoableEdit.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/undo/PasteUndoableEdit.java?rev=1334405&r1=1334404&r2=1334405&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/undo/PasteUndoableEdit.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/undo/PasteUndoableEdit.java
Sat May  5 11:49:38 2012
@@ -27,6 +27,7 @@ import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbRelationship;
+import org.apache.cayenne.map.Embeddable;
 import org.apache.cayenne.map.ObjAttribute;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.ObjRelationship;
@@ -109,7 +110,10 @@ public class PasteUndoableEdit extends C
             }
         }
         else if (where instanceof DbEntity) {
-            if (content instanceof DbAttribute) {
+            if (content instanceof DbEntity) {
+                rAction.removeDbEntity(map, (DbEntity) content);
+            }
+            else if (content instanceof DbAttribute) {
                 rAttributeAction.removeDbAttributes(
                         map,
                         (DbEntity) where,
@@ -126,7 +130,10 @@ public class PasteUndoableEdit extends C
             }
         }
         else if (where instanceof ObjEntity) {
-            if (content instanceof ObjAttribute) {
+            if (content instanceof ObjEntity) {
+                rAction.removeObjEntity(map, (ObjEntity) content);
+            }
+            else if (content instanceof ObjAttribute) {
                 rAttributeAction.removeObjAttributes(
                         (ObjEntity) where,
                         new ObjAttribute[] {
@@ -151,5 +158,8 @@ public class PasteUndoableEdit extends C
                         });
             }
         }
+        else if (content instanceof Embeddable) {
+            rAction.removeEmbeddable(map, (Embeddable) content);
+        }
     }
 }



Mime
View raw message