Javadogs,

I've updated the javadoc for PersistenceCapable and JDOImplHelper; and removed obsolete constants and added missing constants and methods to FetchPlan.

Please take a look.

Thanks,

Craig

Index: src/java/javax/jdo/FetchPlan.java
===================================================================
--- src/java/javax/jdo/FetchPlan.java   (revision 231530)
+++ src/java/javax/jdo/FetchPlan.java   (working copy)
@@ -55,19 +55,22 @@
     public static final String ALL = "all";
 
     /**
-     * For use with [EMAIL PROTECTED] #addGroup}, [EMAIL PROTECTED] 
#removeGroup}, and the
-     * various [EMAIL PROTECTED] #setGroups} calls. Value: <code>values</code>.
+     * For use with [EMAIL PROTECTED] PersistenceManager#detach} and
+     * [EMAIL PROTECTED] #setDetachmentOptions}. Specifies that
+     * fields that are loaded but not in the current fetch plan should
+     * be unloaded prior to detachment.
      * @since 2.0
      */
-    public static final String VALUES = "values";
+    public static final int DETACH_UNLOAD_FIELDS = 2;
 
     /**
-     * For use with [EMAIL PROTECTED] #addGroup}, [EMAIL PROTECTED] 
#removeGroup}, and the
-     * various [EMAIL PROTECTED] #setGroups} calls. Value: <code>none</code>.
-     * ### this is not mentioned in 12.7.2. It is referred to in 12.7's text.
+     * For use with [EMAIL PROTECTED] PersistenceManager#detach} and
+     * [EMAIL PROTECTED] #setDetachmentOptions}. Specifies that
+     * fields that are not loaded but are in the current fetch plan should
+     * be loaded prior to detachment.
      * @since 2.0
      */
-    public static final String NONE = "none";
+    public static final int DETACH_LOAD_FIELDS = 1;
 
     /**
      * For use with [EMAIL PROTECTED] #setFetchSize}. Value: -1.
@@ -151,4 +154,15 @@
      * @since 2.0
      */
     int getFetchSize(); 
+    
+    /**
+     * Set options to be used during detachment. Options are [EMAIL PROTECTED]
+     * #DETACH_LOAD_FIELDS} and [EMAIL PROTECTED] #DETACH_UNLOAD_FIELDS}.
+     */
+    FetchPlan setDetachmentOptions(int options);
+    
+    /**
+     * Get options used during detachment.
+     */
+    int getDetachmentOptions();
 }
\ No newline at end of file
Index: src/java/javax/jdo/spi/PersistenceCapable.java
===================================================================
--- src/java/javax/jdo/spi/PersistenceCapable.java      (revision 231530)
+++ src/java/javax/jdo/spi/PersistenceCapable.java      (working copy)
@@ -351,22 +351,24 @@
     Object jdoNewObjectIdInstance();
     
     /** Create a new instance of the class used for JDO identity, using the
-     * key constructor of the object id class. It is intended only for single
+     * key constructor of the object id class. It is intended for single
      * field identity. The identity
      * instance returned has no relationship with the values of the primary key
      * fields of the persistence-capable instance on which the method is 
called.
      * If the key is the wrong class for the object id class, null is returned.
      * <P>For classes that use single field identity, if the parameter is of 
one 
      * of the following types, the behavior must be as specified:
-     * <ul><li><code>Number</code>: the numeric value of the proper type 
-     * is extracted from
-     * the parameter and passed to the single field identity constructor
+     * <ul><li><code>Number</code>: the  parameter must be the single field
+     * type or the wrapper class of a primitive field type; the parameter
+     * is passed to the single field identity constructor
      * </li><li><code>ObjectIdFieldProvider</code>: the numeric value 
-     * of the proper type
+     * of the proper type or the wrapper value (for wrapper field types)
      * is fetched from the <code>ObjectIdFieldProvider</code> and passed to 
the 
      * single field identity constructor
      * </li><li><code>String</code>: the String is passed to the 
      * single field identity constructor
+     * </li><li>Character: the Character
+     * is passed to the CharIdentity constructor.
      * </li></ul>
      * @return the new instance created.
      * @param o the object identity constructor parameter
Index: src/java/javax/jdo/spi/JDOImplHelper.java
===================================================================
--- src/java/javax/jdo/spi/JDOImplHelper.java   (revision 231530)
+++ src/java/javax/jdo/spi/JDOImplHelper.java   (working copy)
@@ -201,8 +201,15 @@
     
     /** Create a new instance of the ObjectId class of this
      * <code>PersistenceCapable</code> class.
+     * It is intended only for application identity. This method should
+     * not be called for classes that use single field identity;
+     * newObjectIdInstance(Class, Object) should be used instead. 
+     * If the class has been 
+     * enhanced for datastore identity, or if the class is abstract, 
+     * null is returned.
      * @param pcClass the <code>PersistenceCapable</code> class.
-     * @return the new ObjectId instance, or <code>null</code> if the class is 
not registered.
+     * @return the new ObjectId instance, or <code>null</code> if the class 
+     * is not registered.
      */    
     public Object newObjectIdInstance (Class pcClass) {
         Meta meta = getMeta (pcClass);
@@ -212,6 +219,21 @@
     
     /** Create a new instance of the ObjectId class of this 
<code>PersistenceCapable</code>
      * class, using the <code>Object</code> form of the constructor.
+     * If the key is the wrong class for the object id class, null is returned.
+     * <P>For classes that use single field identity, if the parameter is of 
one 
+     * of the following types, the behavior must be as specified:
+     * <ul><li><code>Number</code>: the  parameter must be the single field
+     * type or the wrapper class of a primitive field type; the parameter
+     * is passed to the single field identity constructor
+     * </li><li><code>ObjectIdFieldProvider</code>: the numeric value 
+     * of the proper type or the wrapper value (for wrapper field types)
+     * is fetched from the <code>ObjectIdFieldProvider</code> and passed to 
the 
+     * single field identity constructor
+     * </li><li><code>String</code>: the String is passed to the 
+     * single field identity constructor
+     * </li><li>Character: the Character
+     * is passed to the CharIdentity constructor.
+     * </li></ul>
      * @return the new ObjectId instance, or <code>null</code> if the class is 
not registered.
      * @param obj the <code>Object</code> form of the object id
      * @param pcClass the <code>PersistenceCapable</code> class.

Craig Russell

Architect, Sun Java Enterprise System http://java.sun.com/products/jdo

408 276-5638 mailto:[EMAIL PROTECTED]

P.S. A good JDO? O, Gasp!


Attachment: smime.p7s
Description: S/MIME cryptographic signature



Reply via email to