[Opensource] usage of DBObject.delete() (4.02)

larry hamel expresso at codeguild.com
Wed Sep 11 21:25:50 PDT 2002


you want "deleteAll()"

the javadoc for delete() already specifically mentions as that the key for the object is use:

     * Delete this record from the target table. The current field values for the key
     * of this object tell us which record to delete. This default version
     * of delete also deletes associated detail records (e.g. performs a
     * "cascading delete" of details.

I added the following ref:

         *
         * @see DeleteAll to delete objects identified by non-key fields


why?  I suppose the reason is that the SQL statement using just the keys is very small and efficient.  Using the values of all fields is relatively expensive.

larry

At 03:04 PM 9/11/2002, you wrote:
>I would have guessed that setting any field for a DBObject and then doing a .delete() would generate a where clause from the set fields and do the delete. It appears, though, that it only takes key fields into account.
> 
>Is this intentional? Can we get this added to the javadocs for delete()? Also, why?
> 
>Thanks,
>Mike
> 




More information about the Opensource mailing list