db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r189916 - in /incubator/jdo/trunk: core20/src/java/org/apache/jdo/impl/model/jdo/util/PrintSupport.java runtime20/src/java/org/apache/jdo/impl/state/SCOProcessor.java
Date Fri, 10 Jun 2005 07:48:57 GMT
Author: mbo
Date: Fri Jun 10 00:48:54 2005
New Revision: 189916

URL: http://svn.apache.org/viewcvs?rev=189916&view=rev
Log:
Use new JDO model methods to check the kind of a relatgionship

Modified:
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/PrintSupport.java
    incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/SCOProcessor.java

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/PrintSupport.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/PrintSupport.java?rev=189916&r1=189915&r2=189916&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/PrintSupport.java
(original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/PrintSupport.java
Fri Jun 10 00:48:54 2005
@@ -170,13 +170,13 @@
         if (jdoRelationship == null) 
             return;
 
-        if (jdoRelationship instanceof JDOReference)
+        if (jdoRelationship.isJDOReference())
             printJDOReference(indent, (JDOReference)jdoRelationship);
-        else if (jdoRelationship instanceof JDOCollection)
+        else if (jdoRelationship.isJDOCollection())
             printJDOCollection(indent, (JDOCollection)jdoRelationship);
-        else if (jdoRelationship instanceof JDOArray)
+        else if (jdoRelationship.isJDOArray())
             printJDOArray(indent, (JDOArray)jdoRelationship);
-        else if (jdoRelationship instanceof JDOMap)
+        else if (jdoRelationship.isJDOMap())
             printJDOMap(indent, (JDOMap)jdoRelationship);
     }
     

Modified: incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/SCOProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/SCOProcessor.java?rev=189916&r1=189915&r2=189916&view=diff
==============================================================================
--- incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/SCOProcessor.java (original)
+++ incubator/jdo/trunk/runtime20/src/java/org/apache/jdo/impl/state/SCOProcessor.java Fri
Jun 10 00:48:54 2005
@@ -32,6 +32,7 @@
 import org.apache.jdo.model.jdo.JDOCollection;
 import org.apache.jdo.model.jdo.JDOField;
 import org.apache.jdo.model.jdo.JDOMap;
+import org.apache.jdo.model.jdo.JDORelationship;
 import org.apache.jdo.pm.PersistenceManagerInternal;
 import org.apache.jdo.sco.SCO;
 import org.apache.jdo.sco.SCOCollection;
@@ -288,8 +289,8 @@
             boolean allowNulls = true;
 
             Collection c = (Collection)o;
-            Object rl = jdoField.getRelationship();
-            if (rl != null && rl instanceof JDOCollection) {
+            JDORelationship rl = jdoField.getRelationship();
+            if (rl != null && rl.isJDOCollection()) {
                 el = javaModelFactory.getJavaClass(((JDOCollection)rl).
                                                    getElementType());
             }
@@ -314,8 +315,8 @@
             Class c = ((SCOCollection)o).getElementType();
 
             Class el = null;
-            Object rl = jdoField.getRelationship(); 
-            if (rl != null && rl instanceof JDOCollection) { 
+            JDORelationship rl = jdoField.getRelationship(); 
+            if (rl != null && rl.isJDOCollection()) { 
                 el = javaModelFactory.getJavaClass(((JDOCollection)rl).
                                                    getElementType()); 
             }
@@ -389,8 +390,8 @@
             // Key/value types:
             Class el = null;
             Class k = null;
-            Object rl = jdoField.getRelationship();
-            if (rl != null && rl instanceof JDOMap) {
+            JDORelationship rl = jdoField.getRelationship();
+            if (rl != null && rl.isJDOMap()) {
                 el = javaModelFactory.getJavaClass(((JDOMap)rl).getValueType());
                 k =  javaModelFactory.getJavaClass(((JDOMap)rl).getKeyType());
             }
@@ -409,8 +410,8 @@
          */  
         void assertSCOElementType(Object o, JDOField jdoField) { 
             SCOMap m = (SCOMap)o;
-            Object rl = jdoField.getRelationship();
-            if (rl != null && rl instanceof JDOMap) {
+            JDORelationship rl = jdoField.getRelationship();
+            if (rl != null && rl.isJDOMap()) {
                 JDOMap rm = (JDOMap) rl;
 
                 Class c = m.getValueType();



Mime
View raw message