Does this link help

http://jakarta.apache.org/turbine/howto/peers-howto.html

<snip>
select * from abc where (a < 1 and b > 2) or (  a > 5  and b < 3)

Criteria crit = new Criteria();
Criteria.Criterion a1 = crit.getNewCriterion(ABC.A, 1, Criteria.LESS_THAN);
Criteria.Criterion b2 = crit.getNewCriterion(ABC.B, 2,
Criteria.GREATER_THAN);
Criteria.Criterion a5 = crit.getNewCriterion(ABC.A, 5,
Criteria.GREATER_THAN);
Criteria.Criterion b3 = crit.getNewCriterion(ABC.B, 3, Criteria.LESS_THAN);

crit.add( a1.and(b2).or(a5.and(b3)) );


</snip>


----- Original Message -----
From: "Andrea Papotti" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 25, 2001 4:22 PM
Subject: Re: Another Criteria Help


>
> ----- Original Message -----
> From: "Colin Chalmers" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 25, 2001 3:42 PM
> Subject: Re: Another Criteria Help
>
>
> > I meant off course Criterion object.
> >
> > /Colin
> >
>
> the only page I've found is
> http://jakarta.apache.org/turbine/howto/criteria-howto.html
>
> which describe how to use criterion to check one column against two
values,
> but I need to check two different columns against a value.
>
> Do you mean that I can specify more than a column in a single criterion??
>
> Andrea
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to