turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Chalmers" <colin.chalm...@maxware.nl>
Subject Re: Or in Criteria
Date Tue, 23 Oct 2001 09:49:58 GMT
try this

<snip>
   Criteria crit = new Criteria();
   Criteria.Criterion a1 = crit.getNewCriterion(UssPeer.USS_TYPE, "Name",
Criteria.EQUAL);
   Criteria.Criterion a2 = crit.getNewCriterion(UssPeer.USS_TYPE, "Surname",
Criteria.EQUAL);
      crit.add( a1.or(a2));

   Vector lUssVect = UssPeer.doSelect(crit);
</snip>

hope this helps

/Colin

----- Original Message -----
From: <paul.hunter@bt.com>
To: <turbine-user@jakarta.apache.org>
Sent: Tuesday, October 23, 2001 11:28 AM
Subject: Or in Criteria


> I am trying to create a query which is 'or'ing 2 different columns
(col1="a"
> or col2="a").
>
> I have used criteria.or(col1,"a") followed by criteria.or(col2,"a") but it
> puts an 'and' in the sql instead of an 'or'.  What am I doing wrong?
>
> Cheers,
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>


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


Mime
View raw message