cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1327590 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbLoaderHelper.java
Date Wed, 18 Apr 2012 17:31:50 GMT
Author: aadamchik
Date: Wed Apr 18 17:31:49 2012
New Revision: 1327590

URL: http://svn.apache.org/viewvc?rev=1327590&view=rev
Log:
CAY-1697 Error on Save after importing database

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/dialog/db/DbLoaderHelper.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=1327590&r1=1327589&r2=1327590&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 Wed Apr 18 17:31:49 2012
@@ -67,6 +67,7 @@ CAY-1631 Oracle - passing blobs as store
 CAY-1632 CayenneModeler: flattened relationship paths are not fully displayed
 CAY-1648 [PATCH] ValidationException throws format exception if error message contains percent
sign
 CAY-1696 Undo/Redo stop working after deleting several project items at once
+CAY-1697 Error on Save after importing database
 
 ----------------------------------
 Release: 3.1 M3

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbLoaderHelper.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbLoaderHelper.java?rev=1327590&r1=1327589&r2=1327590&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbLoaderHelper.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbLoaderHelper.java
Wed Apr 18 17:31:49 2012
@@ -46,6 +46,7 @@ import org.apache.cayenne.modeler.Applic
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.event.DataMapDisplayEvent;
 import org.apache.cayenne.modeler.util.LongRunningTask;
+import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.util.DeleteRuleUpdater;
 import org.apache.cayenne.util.NamedObjectFactory;
 import org.apache.cayenne.util.Util;
@@ -424,6 +425,15 @@ public class DbLoaderHelper {
                         .getRootNode(), mediator.getCurrentDataNode()));
             }
             else {
+                DataChannelDescriptor currentDomain = (DataChannelDescriptor) mediator
+                        .getProject().getRootNode();
+                Resource baseResource = currentDomain.getConfigurationSource();
+
+                // this will be new data map so need to set configuration source for it
+                if (baseResource != null) {
+                    Resource dataMapResource = baseResource.getRelativeResource(dataMap.getName());
+                    dataMap.setConfigurationSource(dataMapResource);
+                }
                 mediator.addDataMap(Application.getFrame(), dataMap);
             }
         }



Mime
View raw message