Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 52165 invoked from network); 24 Nov 2003 16:20:51 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Nov 2003 16:20:51 -0000 Received: (qmail 7304 invoked by uid 500); 24 Nov 2003 16:20:31 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 7286 invoked by uid 500); 24 Nov 2003 16:20:31 -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 7252 invoked from network); 24 Nov 2003 16:20:30 -0000 Received: from unknown (HELO maxout1.maxwell.af.mil) (132.60.7.112) by daedalus.apache.org with SMTP; 24 Nov 2003 16:20:30 -0000 Received: from maxvs04.maxwell.aetc.ds.af.mil (maxvs04.maxwell.aetc.ds.af.mil [132.60.100.154]) by maxout1.maxwell.af.mil (8.12.8/8.12.6) with SMTP id h7ENv4dw016921 for ; Thu, 14 Aug 2003 19:57:14 -0400 Received: from fspnqs02.maxwell.aetc.ds.af.mil ([132.60.100.19]) by maxvs04.maxwell.aetc.ds.af.mil (SAVSMTP 3.1.1.32) with SMTP id M2003112410201109213 for ; Mon, 24 Nov 2003 10:20:11 -0600 Received: by fspnqs02.maxwell.aetc.ds.af.mil with Internet Mail Service (5.5.2657.72) id ; Mon, 24 Nov 2003 10:20:12 -0600 Message-ID: <9F0966B04BFACE45B0C383796159AFDC57A7EF@fspnqs06.maxwell.aetc.ds.af.mil> From: Jarnot Voytek Contr AU HQ/SC To: "'Apache Torque Users List'" Subject: RE: Help on building an sql criteria Date: Mon, 24 Nov 2003 10:20:06 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" 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 Never mind my answer please, I just realized that you have articleName and articleNumber; not articleName twice (as I had thought) ... > -----Original Message----- > From: Jarnot Voytek Contr AU HQ/SC > [mailto:Voytek.Jarnot@maxwell.af.mil] > Sent: Monday, November 24, 2003 10:18 AM > To: 'Apache Torque Users List' > Subject: RE: Help on building an sql criteria > > > How about this: > > ... > criteria.add(YourPeer.ARTICLENAME, "%searchString%", Criteria.LIKE); > Criteria.Criterion criterion = > criteria.getCriterion(YourPeer.ARTICLENAME); > criterion.or(criteria.getNewCriterion( > criterion.getTable(), > criterion.getColumn(), > "%searchString%", > Criteria.LIKE )); > ... > > Try that. > > By the way, I essentially cut and paste the code above from the torque > website - the criteria howto should be your first resource: > http://db.apache.org/torque/criteria-howto.html > > -- > Voytek Jarnot > Quantum materiae materietur marmota monax si marmota monax > materiam possit > materiari? > > > > -----Original Message----- > > From: Founaboui Haman [mailto:fhaman@kommunity.net] > > Sent: Monday, November 24, 2003 10:10 AM > > To: torque-user@db.apache.org > > Subject: Help on building an sql criteria > > > > > > Hi there, > > > > I am looking for a way to build the following criteria in torque. > > The sql: > > > > SELECT * FROM articles WHERE any condition AND (articlename > > LIKE '%seachString%' OR articleNumber LIKE '%searchString%'); > > > > My problem resides in the criteria between the parenthesis. > > Any help with code shnippet could be appreciated. > > Thank for your help > > > > haman > > > > --------------------------------------------------------------------- > 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