From a6f62b829c605518e6404f5a63d52a5fbe4b74fc Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Thu, 22 Jul 2010 02:43:16 +0000 Subject: [PATCH] resolves OPENJPA-1743: anchors in mappingtool config invocation git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.0.x@966482 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/lib/conf/ConfigurationImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java index 33b69ab30..1f655ab78 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java @@ -840,7 +840,14 @@ public class ConfigurationImpl * properties value with the name of a resource. */ public void setProperties(String resourceName) throws IOException { - ProductDerivations.load(resourceName, null, + String anchor = null; + if (resourceName.indexOf("#") != -1) + { + anchor = resourceName.substring(resourceName.lastIndexOf("#") + 1); + resourceName = resourceName.substring(0, + resourceName.length() - anchor.length() - 1); + } + ProductDerivations.load(resourceName, anchor, getClass().getClassLoader()).setInto(this); _auto = resourceName; }