db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r581406 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java
Date Tue, 02 Oct 2007 22:04:25 GMT
Author: arminw
Date: Tue Oct  2 15:04:24 2007
New Revision: 581406

URL: http://svn.apache.org/viewvc?rev=581406&view=rev
Log:
improve table per sub-class inheritance

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java?rev=581406&r1=581405&r2=581406&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java
Tue Oct  2 15:04:24 2007
@@ -26,7 +26,6 @@
 import org.apache.ojb.broker.metadata.fieldaccess.PersistentField;
 import org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldFactory;
 import org.apache.ojb.broker.util.ClassHelper;
-import org.apache.ojb.broker.util.ConvertHelper;
 import org.apache.ojb.broker.util.logging.Logger;
 import org.apache.ojb.broker.util.logging.LoggerFactory;
 import org.xml.sax.Attributes;
@@ -554,13 +553,17 @@
                         ObjectReferenceDescriptor ord;
                         if (name.equals(TAG_SUPER))
                         {
-                            // no longer needed sine SuperReferenceDescriptor was used
-//                            checkThis(classRef);
-//                            AnonymousObjectReferenceDescriptor aord =
-//                                new AnonymousObjectReferenceDescriptor(m_CurrentCLD);
-//                            aord.setPersistentField(null, TAG_SUPER);
-//                            ord = aord;
-
+                            // if the referenced super-class is not specified, try to resolve
it
+                            if(!checkString(classRef))
+                            {
+                                Class superClass = ClassHelper.getSuperClass(m_CurrentCLD.getClassOfObject());
+                                if(superClass != null)
+                                {
+                                    classRef = superClass.getName();
+                                    logger.info("Automatic assignment of the super-class
in super-reference of class '"
+                                            + m_CurrentCLD.getClassNameOfObject() + "' -->
super-class=" + classRef);
+                                }
+                            }
                             ord = new SuperReferenceDescriptor(m_CurrentCLD);
                         }
                         else



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message