db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r232296 - /incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/TypeSupport.java
Date Fri, 12 Aug 2005 13:51:18 GMT
Author: mbo
Date: Fri Aug 12 06:51:13 2005
New Revision: 232296

URL: http://svn.apache.org/viewcvs?rev=232296&view=rev
Log:
Added support for ObjectIdentity to JDOModel

Modified:
    incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/TypeSupport.java

Modified: incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/TypeSupport.java
URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/TypeSupport.java?rev=232296&r1=232295&r2=232296&view=diff
==============================================================================
--- incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/TypeSupport.java
(original)
+++ incubator/jdo/trunk/core20/src/java/org/apache/jdo/impl/model/jdo/util/TypeSupport.java
Fri Aug 12 06:51:13 2005
@@ -56,39 +56,43 @@
         // initialize map of singleFieldObjectIdClassNames
         singleFieldObjectIdClassNames.put(
             "byte", //NOI18N
-            "com.sun.persistence.support.identity.ByteIdentity"); //NOI18N
+            "javax.jdo.identity.ByteIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "java.lang.Byte", //NOI18N
-            "com.sun.persistence.support.identity.ByteIdentity"); //NOI18N
+            "javax.jdo.identity.ByteIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "char", //NOI18N
-            "com.sun.persistence.support.identity.CharIdentity"); //NOI18N
+            "javax.jdo.identity.CharIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "java.lang.Char", //NOI18N
-            "com.sun.persistence.support.identity.CharIdentity"); //NOI18N
+            "javax.jdo.identity.CharIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "int", //NOI18N
-            "com.sun.persistence.support.identity.IntIdentity"); //NOI18N
+            "javax.jdo.identity.IntIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "java.lang.Integer",  //NOI18N
-            "com.sun.persistence.support.identity.IntIdentity"); //NOI18N
+            "javax.jdo.identity.IntIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "long",  //NOI18N
-            "com.sun.persistence.support.identity.LongIdentity"); //NOI18N
+            "javax.jdo.identity.LongIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "java.lang.Long",  //NOI18N
-            "com.sun.persistence.support.identity.LongIdentity"); //NOI18N
+            "javax.jdo.identity.LongIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "short", //NOI18N
-            "com.sun.persistence.support.identity.ShortIdentity"); //NOI18N
+            "javax.jdo.identity.ShortIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "java.lang.Short", //NOI18N
-            "com.sun.persistence.support.identity.ShortIdentity"); //NOI18N
+            "javax.jdo.identity.ShortIdentity"); //NOI18N
         singleFieldObjectIdClassNames.put(
             "java.lang.String", //NOI18N
-            "com.sun.persistence.support.identity.StringIdentity"); //NOI18N
+            "javax.jdo.identity.StringIdentity"); //NOI18N
     }
 
+    /** Fully qualified class name of the ObjectIdentity class. */
+    private static final String OBJECT_IDENTITY_NAME =  
+        "javax.jdo.identity.ObjectIdentity"; //NOI18N
+    
     /** 
      * Returns <code>true</code> if the persistence-modifier of a field
      * having the specified type defaults to <code>true</code>. 
@@ -187,13 +191,17 @@
     
     /** 
      * Returns the name of a single field ObjectId class, if the specified
-     * type name denotes a type that is suitable for single fiedl identity.
+     * type name denotes a type that is suitable for single field identity.
      * @param typeName the type to be checked
      */
     public static String getSingleFieldObjectIdClassName(String typeName) {
         if (typeName == null)
             return null;
-        return (String) singleFieldObjectIdClassNames.get(typeName);
+        String singleFieldObjectIdClassName = 
+            (String) singleFieldObjectIdClassNames.get(typeName);
+        if (singleFieldObjectIdClassName == null)
+            singleFieldObjectIdClassName = OBJECT_IDENTITY_NAME;
+        return singleFieldObjectIdClassName;
     }
 
     //========= Internal helper methods ==========



Mime
View raw message