In situations like this (with PK available) I usually set the criteria to specify the object, perform a doSelect() to get the object, update the attributes and then call save(). An UPDATE statement is then generated.
I haven't tried an update that touches a lot of records yet, maybe that's where you should use a doUpdate()
gr. Michel
Benoit Tramblay wrote:
Hello,
I want write this SQL Command with Torque
Update table set col = ..., timeStamp = newTime where id = .. and timestamp = oldTime
I tried to use the function ObjectPeer.doUpdate(Criteria, connection) with this criteria but doesnt work.
// Set
criteria.add(ID, obj.getId());
criteria.add(AU_LAST_UPDATE_DATE,updateDate);
// Clause SQL
criteria.add(AU_LAST_UPDATE_DATE, (Object)req , Criteria.CUSTOM);
Thanks.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
