openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrba...@apache.org
Subject svn commit: r1242547 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/XMLValueHandler.java
Date Thu, 09 Feb 2012 21:52:28 GMT
Author: jrbauer
Date: Thu Feb  9 21:52:28 2012
New Revision: 1242547

URL: http://svn.apache.org/viewvc?rev=1242547&view=rev
Log:
OPENJPA-2124 Committing patch contributed by Helen Xu.  Test covered by existing jUnit.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/XMLValueHandler.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/XMLValueHandler.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/XMLValueHandler.java?rev=1242547&r1=1242546&r2=1242547&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/XMLValueHandler.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/XMLValueHandler.java
Thu Feb  9 21:52:28 2012
@@ -98,7 +98,12 @@ public class XMLValueHandler
         if (val == null) 
             return null;
         try {
-            String packageName = vm.getDeclaredType().getPackage().getName();
+            String className  = vm.getDeclaredType().getName();
+            int i = className.lastIndexOf('.');
+            String packageName = className;
+            if (i != -1) {
+                packageName = className.substring(0, i);
+            }
             JAXBContext jc = JAXBContext.newInstance(packageName);
             Unmarshaller u = jc.createUnmarshaller();
             return u.unmarshal(new StreamSource(new StringReader



Mime
View raw message