cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkazimirc...@apache.org
Subject svn commit: r1538459 - /cayenne/main/branches/STABLE-3.1/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
Date Sun, 03 Nov 2013 21:20:36 GMT
Author: dkazimirchyk
Date: Sun Nov  3 21:20:35 2013
New Revision: 1538459

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

patch by Oleg Artyukevich

Modified:
    cayenne/main/branches/STABLE-3.1/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java

Modified: cayenne/main/branches/STABLE-3.1/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.1/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java?rev=1538459&r1=1538458&r2=1538459&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.1/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
(original)
+++ cayenne/main/branches/STABLE-3.1/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ImportDataMapAction.java
Sun Nov  3 21:20:35 2013
@@ -33,6 +33,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.cayenne.util.ResourceLocator;
 import org.apache.commons.logging.Log;
@@ -92,6 +93,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