cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: Set dataMap configuration source in data map loader, not in project loader
Date Thu, 08 Nov 2018 14:03:24 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 9451c9a83 -> 8f6cfd796


Set dataMap configuration source in data map loader, not in project loader


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

Branch: refs/heads/master
Commit: 8f6cfd7966ab09166fc6c07b18cc4ed6eb624e10
Parents: 9451c9a
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Thu Nov 8 17:03:08 2018 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Thu Nov 8 17:03:08 2018 +0300

----------------------------------------------------------------------
 .../cayenne/configuration/xml/DataChannelChildrenHandler.java   | 1 -
 .../org/apache/cayenne/configuration/xml/XMLDataMapLoader.java  | 5 ++++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/8f6cfd79/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
index 99d1f7a..f93a368 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/DataChannelChildrenHandler.java
@@ -112,7 +112,6 @@ final class DataChannelChildrenHandler extends NamespaceAwareNestedTagHandler
{
         DataMap dataMap = xmlDataChannelDescriptorLoader.dataMapLoader.load(dataMapResource);
         dataMap.setName(dataMapName);
         dataMap.setLocation(dataMapLocation);
-        dataMap.setConfigurationSource(dataMapResource);
         dataMap.setDataChannelDescriptor(descriptor);
 
         descriptor.getDataMaps().add(dataMap);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/8f6cfd79/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataMapLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataMapLoader.java
b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataMapLoader.java
index fa61842..5e9f630 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataMapLoader.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/configuration/xml/XMLDataMapLoader.java
@@ -50,7 +50,10 @@ public class XMLDataMapLoader implements DataMapLoader {
         try(InputStream in = configurationResource.getURL().openStream()) {
             XMLReader parser = xmlReaderProvider.get();
             LoaderContext loaderContext = new LoaderContext(parser, handlerFactory);
-            loaderContext.addDataMapListener(dataMap -> maps[0] = dataMap);
+            loaderContext.addDataMapListener(dataMap -> {
+                dataMap.setConfigurationSource(configurationResource);
+                maps[0] = dataMap;
+            });
             RootDataMapHandler rootHandler = new RootDataMapHandler(loaderContext);
 
             parser.setContentHandler(rootHandler);


Mime
View raw message