turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Bachelder" <cho...@chowda.net>
Subject Criteria and where clause
Date Sun, 28 Oct 2001 22:23:21 GMT
a criteria created like this:

crit = crit.or(LAST_NAME, (Object)keyword, Criteria.LIKE)
              .or(FIRST_NAME, (Object)keyword, Criteria.LIKE)
              .or(MIDDLE_I, (Object)keyword, Criteria.LIKE);

and keyword.equals("a") gives me the following where clause....

WHERE (CONTACT.LAST_NAME = 'a') AND (CONTACT.MIDDLE_I = 'a') AND
(CONTACT.FIRST_NAME = 'a')

what I want to see is:

WHERE (CONTACT.LAST_NAME LIKE '%a%') OR (CONTACT.MIDDLE_I LIKE '%a%') OR
(CONTACT.FIRST_NAME LIKE '%a%')

I assumed Criteria.or() use the OR logical operator instead of the AND... I
also assumed Criteria.LIKE would use the LIKE operator... where have I gone
wrong?

thanks,
dan





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