db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Wassermann <mwasserm...@mw-net.com>
Subject Problem with OR Clause
Date Fri, 11 May 2007 07:29:15 GMT
Hi List

Im using torque 3.1.1 as part of turbine 2.3.2.

I want to create a quere to find an expression in one of the text
collums of a table. I tryed to use the Criteria.or method, but it dose
not work right. The debug log shows that torque is gnerating the clause
with AND instead of OR.

What did I do wrong?

thx4help
Mark

-- CODE --
crit.add(TicketPeer.LOCATION, project);
crit.add(TicketPeer.LAST_NAME, searchField).or(TicketPeer.VENDOR,
searchField).or(TicketPeer.MODEL, searchField);
-- CODE --

--LOG --
2007-05-10 11:57:38,484 [http-8080-2] DEBUG
org.apache.torque.util.BasePeer - SELECT TICKET.ID,
TICKET.CUSTOMER_TYPE_ID, TICKET.CUSTOMER_NR, TICKET.FIRST_NAME,
TICKET.LAST_NAME, TICKET.ADRESS, TICKET.ZIP, TICKET.CITY,
TICKET.COUNTRY, TICKET.PHONE, TICKET.VEHICLE_TYPE_ID, TICKET.VENDOR,
TICKET.MODEL, TICKET.CAR_NUMBER, TICKET.DESCRIPTION, TICKET.TRANSFER,
TICKET.LOCATION, TICKET.CHECKIN_DATE, TICKET.CHECKIN_CLERK,
TICKET.CHECKOUT_DATE, TICKET.CHECKOUT_CLERK, TICKET.RATE,
TICKET.FREE_DAYS, TICKET.PRICE, TICKET.PAYED, TICKET.CLOSED
FROM TICKET
WHERE TICKET.LOCATION=1000 AND TICKET.LAST_NAME='Wassermann'
ORDER BY TICKET.CHECKIN_DATE ASC
LIMIT 20
--LOG --

-- Mark Wassermann @: mwassermann@mw-net.com

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