db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michel Beijlevelt / Lucka <...@lucka.nl>
Subject Re: How make a SQL clause with doUpdate
Date Mon, 04 Aug 2003 07:16:55 GMT
Howdy,

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: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message