openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wisnes...@apache.org
Subject svn commit: r559172 - in /openjpa/trunk: openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/ openjpa-kernel/src/main/java/org/apache/openjpa/meta/
Date Tue, 24 Jul 2007 19:40:10 GMT
Author: wisneskid
Date: Tue Jul 24 12:40:09 2007
New Revision: 559172

URL: http://svn.apache.org/viewvc?view=rev&rev=559172
Log:
OPENJPA-240 XMLMapping Query - rename XMLMetaData to XMLFieldMetaData
Help Catalina committing changes for renaming classes, part 1.

Added:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java
      - copied, changed from r559165, openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMetaData.java
Removed:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMetaData.java
Modified:
    openjpa/trunk/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java

Modified: openjpa/trunk/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java?view=diff&rev=559172&r1=559171&r2=559172
==============================================================================
--- openjpa/trunk/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java
(original)
+++ openjpa/trunk/openjpa-jdbc-5/src/main/java/org/apache/openjpa/meta/XMLClassMetaData.java
Tue Jul 24 12:40:09 2007
@@ -33,7 +33,7 @@
 import org.apache.openjpa.jdbc.meta.XMLMappingRepository;
 import org.apache.openjpa.meta.JavaTypes;
 import org.apache.openjpa.meta.XMLMapping;
-import org.apache.openjpa.meta.XMLMetaData;
+import org.apache.openjpa.meta.XMLFieldMetaData;
 import org.apache.commons.lang.StringUtils;
 
 /**
@@ -178,8 +178,14 @@
 
     private synchronized void populateFromReflection(Class cls, 
         XMLMappingRepository repos) {
-        Member[] members;
-        if (((XmlAccessorType)cls.getAnnotation(XmlAccessorType.class)).value()
+        Member[] members; 
+        Class superclass = cls.getSuperclass();
+
+        // handle inheritance at sub-element level
+        if (superclass.isAnnotationPresent(XmlType.class))
+            populateFromReflection(superclass, repos);
+
+        if (((XmlAccessorType) cls.getAnnotation(XmlAccessorType.class)).value()
                 == XmlAccessType.FIELD)
             members = cls.getDeclaredFields();
         else
@@ -201,7 +207,7 @@
                     field.setXmlname(xmlname);
                 }
                 else {
-                    field = new XMLMetaData();
+                    field = new XMLFieldMetaData();
                     field.setXmltype(ELEMENT);
                     field.setXmlname(xmlname);
                     field.setXmlnamespace(el.getAnnotation(XmlElement.class)
@@ -209,8 +215,8 @@
                 }
             }
             else if (el.getAnnotation(XmlAttribute.class) != null) {
-                field = new XMLMetaData();
-                field.setXmltype(XMLMetaData.ATTRIBUTE);
+                field = new XMLFieldMetaData();
+                field.setXmltype(XMLFieldMetaData.ATTRIBUTE);
                 String xmlname = el.getAnnotation(XmlAttribute.class).name();
                 // avoid JAXB XML bind default name
                 if (StringUtils.equals(defaultName, xmlname))

Copied: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java
(from r559165, openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMetaData.java)
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java?view=diff&rev=559172&p1=openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMetaData.java&r1=559165&p2=openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java&r2=559172
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLMetaData.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/XMLFieldMetaData.java
Tue Jul 24 12:40:09 2007
@@ -26,7 +26,7 @@
  * @author Catalina Wei
  * @since 1.0.0
  */
-public class XMLMetaData implements XMLMapping {
+public class XMLFieldMetaData implements XMLMapping {
 
     private String _name;
     private String _xmlname = null;
@@ -37,7 +37,7 @@
     private int _code = JavaTypes.OBJECT;
     private int _xmltype;    
 
-    public XMLMetaData() {        
+    public XMLFieldMetaData() {        
     }
     
     public Class getType() {



Mime
View raw message