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 Sven Haiges <sh...@flavor.de> on 2003/11/24 22:29:35 UTC

Criteria OR

I would like to select all rows that either have A=1 or B=1 ?

This is basically a simple OR in a SQL statement.... how can I do that with 
the Criteria object?

criteria.or(ProductPeer.CATEGORY_A, true);
criteria.or(ProductPeer.CATEGORY_B, true);

The sample code above does not work... can someone provide a code sample?

thanx,
sven 

Re: Criteria OR

Posted by Tulsi Das <qu...@yahoo.com>.
You need to use Criterion and or them... search the message archive for
examples.

Tulsi

 --- Sven Haiges <sh...@flavor.de> escribió: 
> I would like to select all rows that either have A=1 or B=1 ?
> 
> This is basically a simple OR in a SQL statement.... how can I do
> that with 
> the Criteria object?
> 
> criteria.or(ProductPeer.CATEGORY_A, true);
> criteria.or(ProductPeer.CATEGORY_B, true);
> 
> The sample code above does not work... can someone provide a code
> sample?
> 
> thanx,
> sven 
> >
---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org 

------------
Los mejores usados y las más tentadoras 
ofertas de 0km están en Yahoo! Autos.
Comprá o vendé tu auto en
http://autos.yahoo.com.ar

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