You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by pc...@apache.org on 2010/07/22 04:43:16 UTC

svn commit: r966482 - /openjpa/branches/2.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java

Author: pcl
Date: Thu Jul 22 02:43:16 2010
New Revision: 966482

URL: http://svn.apache.org/viewvc?rev=966482&view=rev
Log:
resolves OPENJPA-1743: anchors in mappingtool config invocation

Modified:
    openjpa/branches/2.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java

Modified: openjpa/branches/2.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?rev=966482&r1=966481&r2=966482&view=diff
==============================================================================
--- openjpa/branches/2.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java (original)
+++ openjpa/branches/2.0.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java Thu Jul 22 02:43:16 2010
@@ -840,7 +840,14 @@ public class ConfigurationImpl
      * <code>properties</code> 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;
     }