Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 75213 invoked from network); 11 Nov 2003 21:14:35 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 11 Nov 2003 21:14:35 -0000 Received: (qmail 9980 invoked by uid 500); 11 Nov 2003 21:14:21 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 9965 invoked by uid 500); 11 Nov 2003 21:14:21 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 9951 invoked from network); 11 Nov 2003 21:14:21 -0000 Received: from unknown (HELO MAIL.extend.com) (209.47.111.2) by daedalus.apache.org with SMTP; 11 Nov 2003 21:14:21 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: How to update multiple rows Date: Tue, 11 Nov 2003 16:14:26 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: How to update multiple rows Thread-Index: AcOol28EQqUMxJX/SoiTZ4PURwVgjAAAR5BQ From: "Cloves Carneiro Jr." To: "Apache Torque Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N k So, you mean there's no way a bulk update can happen if the primary key = is not included using doUpdate(Criteria) ? -----Original Message----- From: Bill Leng [mailto:wleng@metatomix.com] Sent: Tuesday, November 11, 2003 4:05 PM To: Apache Torque Users List Subject: Re: How to update multiple rows Without a primary key, I guess, you can not use the example to update.=20 If the primary key contains multiple columns, you need to specify all of = them. Hope this helps. Ramesh Sabeti wrote: >I understand that. I can't explain how the example works. Looking at >it, I'd say that both c.add(...) calls add the criteria to the WHERE >clause. How do you interpret it? >=20 >Criteria c =3D new Criteria(); >c.add(BookPeer.BOOK_PRICE, 0); >c.add(BookPeer.BOOK_ID, 100, Criteria.LESS_THAN); >BasePeer.doUpdate(c); > > =20 > >>-----Original Message----- >>From: Tulsi Das [mailto:quixote_arg@yahoo.com] >>Sent: Tuesday, November 11, 2003 12:53 PM >>To: Apache Torque Users List >>Subject: RE: How to update multiple rows >> >>The criteria is just a hashtable extension to store all the mappings, >>later on, when calling the methods, the SQL generator knows where to >>insert them ( if you are lucky ;) ) >> >>tulsi >> >> --- Ramesh Sabeti escribi=F3: >> =20 >> >>>I meant in the example provided by Bill. If you set the criteria as >>>suggested, Torque would use it in the WHERE clause and not in the >>> =20 >>> >SET > =20 > >>>clause, right? >>> >>> =20 >>> >>>>-----Original Message----- >>>>From: Tulsi Das [mailto:quixote_arg@yahoo.com] >>>>Sent: Tuesday, November 11, 2003 12:45 PM >>>>To: Apache Torque Users List >>>>Subject: RE: How to update multiple rows >>>> >>>>It doesn=B4t know untill you call >>>> >>>>doSelect() >>>>or >>>>doUpdate() >>>>or even >>>>doDelete() methods >>>> >>>>that=B4s why it=B4s only called "Criteria" >>>> >>>>regards >>>> >>>>Tulsi >>>> >>>> --- Ramesh Sabeti escribi=F3: >>>> =20 >>>> >>>>>How does torque know that c.add(BookPeer.BOOK_PRICE, 0) is to >>>>> =20 >>>>> >SET > =20 > >>>a >>> =20 >>> >>>>>value and not for comparison purposes? >>>>> >>>>> =20 >>>>> >>>>>>-----Original Message----- >>>>>>From: Bill Leng [mailto:wleng@metatomix.com] >>>>>>Sent: Tuesday, November 11, 2003 6:18 AM >>>>>>To: Apache Torque Users List >>>>>>Subject: Re: How to update multiple rows >>>>>> >>>>>>You can do something like this >>>>>>Criteria c =3D new Criteria(); >>>>>>c.add(BookPeer.BOOK_PRICE, 0); >>>>>>c.add(BookPeer.BOOK_ID, 100, Criteria.LESS_THAN); >>>>>>BasePeer.doUpdate(c); >>>>>> >>>>>>Ramesh Sabeti wrote: >>>>>> >>>>>> =20 >>>>>> >>>>>>>I have a very simple question: How do you do something like >>>>>>> =20 >>>>>>> >>>this >>> =20 >>> >>>>>with >>>>> =20 >>>>> >>>>>>>Torque? >>>>>>> >>>>>>> Update book set book_price =3D 0 where book_id < 100 >>>>>>> >>>>>>>Wish there were more online resources. >>>>>>> >>>>>>>Thanks, >>>>>>> >>>>>>>Ramesh. >>>>>>> >>>>>>> >>>>>>> >>>>>>> =20 >>>>>>> >>>--------------------------------------------------------------------- >>> =20 >>> >>>>>>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >>>>>>>For additional commands, e-mail: >>>>>>> =20 >>>>>>> >>>torque-user-help@db.apache.org >>> =20 >>> >>>>>>> >>>>>>> =20 >>>>>>> >>>>>>-- >>>>>>Bill Leng >>>>>>Sr. Software Engineer >>>>>>Metatomix, Inc. >>>>>>Tel: (901)261-8911 >>>>>>Fax: (901)261-8901 >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> =20 >>>>>> >--------------------------------------------------------------------- > =20 > >>>>>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >>>>>>For additional commands, e-mail: >>>>>> =20 >>>>>> >torque-user-help@db.apache.org > =20 > >>>>> >>>>> >>>>> =20 >>>>> >--------------------------------------------------------------------- > =20 > >>>>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >>>>>For additional commands, e-mail: torque-user-help@db.apache.org >>>>> >>>>> =20 >>>>> >>>>------------ >>>>=A1Ayud=E1 a los chicos navegando! >>>>En noviembre, Yahoo! dona un plato de comida por cada nuevo >>>> =20 >>>> >usuario > =20 > >>>que >>> =20 >>> >>>>nevegue gratis con Yahoo! Conexi=F3n. >>>>Conectate ya en http://conexion.yahoo.com.ar >>>> >>>> >>>> =20 >>>> >--------------------------------------------------------------------- > =20 > >>>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >>>>For additional commands, e-mail: torque-user-help@db.apache.org >>>> =20 >>>> >>> >>> >>> =20 >>> >--------------------------------------------------------------------- > =20 > >>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >>>For additional commands, e-mail: torque-user-help@db.apache.org >>> >>> =20 >>> >>------------ >>=A1Ayud=E1 a los chicos navegando! >>En noviembre, Yahoo! dona un plato de comida por cada nuevo usuario >> =20 >> >que > =20 > >>nevegue gratis con Yahoo! Conexi=F3n. >>Conectate ya en http://conexion.yahoo.com.ar >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >>For additional commands, e-mail: torque-user-help@db.apache.org >> =20 >> > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org >For additional commands, e-mail: torque-user-help@db.apache.org > > =20 > --=20 Bill Leng Sr. Software Engineer Metatomix, Inc. Tel: (901)261-8911 Fax: (901)261-8901 --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org