cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1538454 - /cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
Date Sun, 03 Nov 2013 21:12:30 GMT
Author: dkazimirchyk
Date: Sun Nov  3 21:12:29 2013
New Revision: 1538454

URL: http://svn.apache.org/r1538454
Log:
CAY-1797 NPE importing DataMap

patch by Oleg Artyukevich

Modified:
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java?rev=1538454&r1=1538453&r2=1538454&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
Sun Nov  3 21:12:29 2013
@@ -36,6 +36,7 @@ import org.apache.cayenne.modeler.Applic
 import org.apache.cayenne.modeler.pref.FSPath;
 import org.apache.cayenne.modeler.util.CayenneAction;
 import org.apache.cayenne.modeler.util.FileFilters;
+import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.util.NamedObjectFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -102,6 +103,13 @@ public class ImportDataMapAction extends
             else {
                 newMap.setName(NamedObjectFactory.createName(DataMap.class, domain));
             }
+            
+            Resource baseResource = domain.getConfigurationSource();
+
+            if(baseResource != null) {
+                Resource dataMapResource = baseResource.getRelativeResource(newMap.getName());
+                newMap.setConfigurationSource(dataMapResource);
+            }
 
             getProjectController().addDataMap(this, newMap);
         }



Mime
View raw message