Hi,
I have a question about how updates work in Torque.

Suppose, I want to do the following.

Update table1 set value1='newPasswd' where value1='oldPasswd' and value2='user4';

Now I guess, the way to do this would be to have 2 criteria's and then call doUpdate in the BasePeer. Something like:

   // Next form the criteria to first select this user from the table.
   Criteria crit1 = new Criteria();
   crit1.add(FilePeer.ID, "user4");
   crit1.add(FilePeer.PASSWORD, "oldPasswd");

   Criteria crit2 = new Criteria();
   crit2.add(FilePeer.PASSWORD, "newPasswd");

BasePeer.doUpdate(crit1, crit2); // Also tried FilePeer.doUpdate - but did'nt work :(

When, I execute the above piece of code, I get a NullPointer Exception.
Exception in thread "main" java.lang.NullPointerException
       at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1888)
       at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1835)


Any suggesttions ??? Thanks in advance. RG.

_________________________________________________________________
Get a FREE online virus check for your PC here, from McAfee. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to