You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by newton mn <ne...@hotmail.com> on 2004/03/22 15:44:20 UTC

Doubt in Torque Update

hi
>   "update UserContentRating set Rating="+rating+ " ,ts='"+ts+"'"+" where
>ContentItemId="+item_id+" and UserId='"+uid+"'";
>
>The above query,  i want to change to Torque , I did below  like
>
>Criteria us2 = new Criteria();
>us2.add(UsercontentratingPeer.RATING,rating);
>us2.add(UsercontentratingPeer.TS,ts);
>Criteria.Criterion cri = us2.getNewCriterion(UsercontentratingPeer.USERID,
>uid, Criteria.EQUAL);
>Criteria.Criterion cri1 =
>us2.getNewCriterion(UsercontentratingPeer.CONTENTITEMID,new
>Integer(item_id),Criteria.EQUAL);
>us2.add(cri.and(cri1));
>UsercontentratingPeer.doUpdate(us2,connection);
>
>In that condition  valuesis not Updated what i given condition
>properly. How can I check the condition in Torque?. any one please help me 
>as soon as possible.
Thanks
Newton
>

_________________________________________________________________
Join BharatMatrimony.com. 
http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?72 Unmarried? Join 
Free.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: Doubt in Torque Update

Posted by Andras Balogh <an...@reea.net>.
Hello,

    I think you have to create 2 Criteria objects and use this method:
 BasePeer.doUpdate(selectCriteria, criteria, con);

Best wishes,
Andras

newton mn wrote:

> hi
>
>>   "update UserContentRating set Rating="+rating+ " ,ts='"+ts+"'"+" where
>> ContentItemId="+item_id+" and UserId='"+uid+"'";
>>
>> The above query,  i want to change to Torque , I did below  like
>>
>> Criteria us2 = new Criteria();
>> us2.add(UsercontentratingPeer.RATING,rating);
>> us2.add(UsercontentratingPeer.TS,ts);
>> Criteria.Criterion cri = 
>> us2.getNewCriterion(UsercontentratingPeer.USERID,
>> uid, Criteria.EQUAL);
>> Criteria.Criterion cri1 =
>> us2.getNewCriterion(UsercontentratingPeer.CONTENTITEMID,new
>> Integer(item_id),Criteria.EQUAL);
>> us2.add(cri.and(cri1));
>> UsercontentratingPeer.doUpdate(us2,connection);
>>
>> In that condition  valuesis not Updated what i given condition
>> properly. How can I check the condition in Torque?. any one please 
>> help me as soon as possible.
>
> Thanks
> Newton
>
>>
>
> _________________________________________________________________
> Join BharatMatrimony.com. 
> http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?72 Unmarried? 
> Join Free.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org