This one time, at band camp, Bates, Alex said:

BA>I'm trying to execute a delete all statement on an object (delete all where
BA>a non-identity field, username, equals a parameter).  I've tried the
BA>following versions, and keep getting an exception:
BA>
BA>
BA>
BA>"DELETE userrole FROM dataobject.UserRoleDO userrole WHERE username = $1";
BA>
BA>"DELETE FROM dataobject.UserRoleDO userrole WHERE username = $1";
BA>
BA>"DELETE dataobject.UserRoleDO userrole WHERE username = $1";

Alex,

This is not how objects are deleted using Castor. To delete objects
utilize the db.remove( object ) method. In order to delete UserRoleDO
objects, first load them using OQL, then pass each materialized
object to the remove() method.

See the following for more info on the remove() method:

    
http://www.castor.org/javadoc/org/exolab/castor/jdo/Database.html#remove(java.lang.Object)

    or

    http://www.castor.org/jdo.html#Create/remove/update

Bruce
--

perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to