db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "RG ." <fun_r...@hotmail.com>
Subject Question abour updates
Date Fri, 23 Jan 2004 08:01:11 GMT
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: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message