Any way thank you for your answer haman
----- Original Message ----- From: "Jarnot Voytek Contr AU HQ/SC" <[EMAIL PROTECTED]> To: "'Apache Torque Users List'" <[EMAIL PROTECTED]> Sent: Monday, November 24, 2003 5:20 PM Subject: RE: Help on building an sql criteria > 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:[EMAIL PROTECTED] > > 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:[EMAIL PROTECTED] > > > Sent: Monday, November 24, 2003 10:10 AM > > > To: [EMAIL PROTECTED] > > > 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]