db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r189820 - in /incubator/jdo/trunk/core20/src/java/org/apache/jdo: impl/model/jdo/JDOArrayImplDynamic.java impl/model/jdo/JDOCollectionImplDynamic.java impl/model/jdo/JDOMapImplDynamic.java impl/model/jdo/JDOReferenceImpl.java impl/model/jdo/JDORelationshipImpl.java model/jdo/JDORelationship.java
Date Thu, 09 Jun 2005 21:10:08 GMT
Author: mbo
Date: Thu Jun  9 14:10:07 2005
New Revision: 189820

URL: http://svn.apache.org/viewcvs?rev=189820&view=rev
Log:
Add JDO model methods to check the kind of a relationship (isJDOCollection, isJDOMap, etc.)

Modified:
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOArrayImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOCollectionImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOMapImplDynamic.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOReferenceImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDORelationshipImpl.java
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDORelationship.java

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOArrayImplDynamic.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOArrayImplDynamic.java?rev=189820&r1=189819&r2=189820&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOArrayImplDynamic.java
(original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOArrayImplDynamic.java
Thu Jun  9 14:10:07 2005
@@ -76,5 +76,15 @@
         return (fieldType != null) ? fieldType.getArrayComponentType() : null;
     }
 
-}
+    /**
+     * Determines whether this JDORelationship represents an array
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOArray instance.
+     * @return <code>true</code> if this JDORelationship represents an 
+     * array relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOArray() {
+        return true;
+    }
 
+}

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOCollectionImplDynamic.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOCollectionImplDynamic.java?rev=189820&r1=189819&r2=189820&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOCollectionImplDynamic.java
(original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOCollectionImplDynamic.java
Thu Jun  9 14:10:07 2005
@@ -99,7 +99,7 @@
                                            jdoClass.getPackagePrefix());
             if (type == null) {
                 throw new ModelFatalException(
-                    msg.msg("EXC_CannotResolveElementType", elementTypeName,
+                    msg.msg("EXC_CannotResolveElementType", elementTypeName, //NOI18N
                             jdoField.getName(), jdoClass.getName())); //NOI18N
             }
         }
@@ -134,5 +134,16 @@
     public void setElementTypeName(String elementTypeName) {
         this.elementTypeName = elementTypeName;
     }
-    
+
+    /**
+     * Determines whether this JDORelationship represents a collection
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOCollection instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * collection relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOCollection() {
+        return true;
+    }
+
 }

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOMapImplDynamic.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOMapImplDynamic.java?rev=189820&r1=189819&r2=189820&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOMapImplDynamic.java
(original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOMapImplDynamic.java
Thu Jun  9 14:10:07 2005
@@ -107,8 +107,8 @@
                                            jdoClass.getPackagePrefix());
             if (type == null) {
                 throw new ModelFatalException(
-                    msg.msg("EXC_CannotResolveKeyType", keyTypeName,
-                            jdoField.getName(), jdoClass.getName())); //NOI18N
+                    msg.msg("EXC_CannotResolveKeyType", keyTypeName, //NOI18N
+                            jdoField.getName(), jdoClass.getName()));
             }
         }
         
@@ -190,8 +190,8 @@
                                            jdoClass.getPackagePrefix());
             if (type == null) {
                 throw new ModelFatalException(
-                    msg.msg("EXC_CannotResolveValueType", valueTypeName,
-                            jdoField.getName(), jdoClass.getName())); //NOI18N
+                    msg.msg("EXC_CannotResolveValueType", valueTypeName, //NOI18N
+                            jdoField.getName(), jdoClass.getName()));
             }
         }
         
@@ -223,6 +223,17 @@
      */
     public void setValueTypeName(String valueTypeName) {
         this.valueTypeName = valueTypeName;
+    }
+
+    /**
+     * Determines whether this JDORelationship represents a map 
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOMap instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * map relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOMap() {
+        return true;
     }
 
 }

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOReferenceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOReferenceImpl.java?rev=189820&r1=189819&r2=189820&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOReferenceImpl.java
(original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDOReferenceImpl.java
Thu Jun  9 14:10:07 2005
@@ -27,5 +27,14 @@
 public class JDOReferenceImpl extends JDORelationshipImpl 
     implements JDOReference
 {
-    // empty implementation
+    /**
+     * Determines whether this JDORelationship represents a reference
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOReference instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * reference relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOReference() {
+        return true;
+    }
 }

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDORelationshipImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDORelationshipImpl.java?rev=189820&r1=189819&r2=189820&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDORelationshipImpl.java
(original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/JDORelationshipImpl.java
Thu Jun  9 14:10:07 2005
@@ -106,4 +106,48 @@
         this.inverse = inverseRelationship;
     }
 
+    /**
+     * Determines whether this JDORelationship represents a reference
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOReference instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * reference relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOReference() {
+        return false;
+    }
+    
+    /**
+     * Determines whether this JDORelationship represents a collection
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOCollection instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * collection relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOCollection() {
+        return false;
+    }
+
+    /**
+     * Determines whether this JDORelationship represents an array
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOArray instance.
+     * @return <code>true</code> if this JDORelationship represents an 
+     * array relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOArray() {
+        return false;
+    }
+
+    /**
+     * Determines whether this JDORelationship represents a map 
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOMap instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * map relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOMap() {
+        return false;
+    }
+
 }

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDORelationship.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDORelationship.java?rev=189820&r1=189819&r2=189820&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDORelationship.java (original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/model/jdo/JDORelationship.java Thu
Jun  9 14:10:07 2005
@@ -100,4 +100,40 @@
     public void setInverseRelationship(JDORelationship inverseRelationship)
         throws ModelException;
 
+    /**
+     * Determines whether this JDORelationship represents a reference
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOReference instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * reference relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOReference();
+    
+    /**
+     * Determines whether this JDORelationship represents a collection
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOCollection instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * collection relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOCollection();
+
+    /**
+     * Determines whether this JDORelationship represents an array
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOArray instance.
+     * @return <code>true</code> if this JDORelationship represents an 
+     * array relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOArray();
+
+    /**
+     * Determines whether this JDORelationship represents a map 
+     * relationship or not. A return of <code>true</code> means this
+     * JDORelationship is a JDOMap instance.
+     * @return <code>true</code> if this JDORelationship represents a
+     * map relationship; <code>false</code> otherwise.
+     */
+    public boolean isJDOMap();
+
 }



Mime
View raw message