db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felipe Ramos" <fra...@tissat.es>
Subject Re: Problem OR\'ing criterias
Date Fri, 31 Oct 2003 08:58:53 GMT
As far as I know, crit.or doesn't work.

You must use Criterion to make 'or' statements, look into de Criteria 
tutorial in the torque web.

denis.griesmeyer@freenet.de wrote:

>Hello torque-users,
>
>I have a problem with OR'ing criterias. 
>
>The code is as follows:
>
>---SNIP---
>
>Criteria crit = new Criteria();
>		
>crit.or (SongsPeer.ARTIST,(Object)searchString,Criteria.LIKE);
>crit.or (SongsPeer.TITLE,(Object)searchString,Criteria.LIKE);
>crit.or (SongsPeer.ALBUM,(Object)searchString,Criteria.LIKE);
>
>---SNIP---
>
>I would expect the query to look sth. like this:
>
>---SNIP---
>...
>FROM SONGS 
>WHERE SONGS.ALBUM LIKE '%4%' OR SONGS.TITLE LIKE '%4%' OR SONGS.ARTIST LIKE '%4%'
>---SNIP---
>
>But instead it AND's all X LIKE Y's together... :-(
>
>Maybe I missunderstood some of the basic concepts of torque... 
>
>Can someone give me a hint please?
>
>Thanks in advance
>Denis
>
>
>  
>

-- 
------------------------
Felipe Ramos
Tissat SA
C/ Orense 34-9ยช
28020 Madrid
Tel: (+34) 91 4175913 
Fax: (+34) 91 4172914
Mail: framos@tissat.es
------------------------




---------------------------------------------------------------------
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