db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derick Fernando" <der...@xenocex.com>
Subject Question about LIKE Criteria
Date Mon, 20 Jan 2003 09:06:36 GMT
Hello,

In my Action class I do this:

Criteria ct = new Criteria();
Criteria.Criterion ctoa = ct.getNewCriterion(ProductsPeer.DESCRIPTION,
(Object) term, Criteria.LIKE);
Criteria.Criterion ctob = ct.getNewCriterion(ProductsPeer.NAME, (Object)
term, Criteria.LIKE);
ct.setIgnoreCase(true);
ct.add( ctoa.or( ctob ) );
ct.setDistinct();
List pro = ProductsPeer.doSelect(ct);

However this creates an equal ("=") query instead of a LIKE query as seen
below. Am I doing something wrong?
I'd like to do this without adding a method to the base classes.

12398 [HttpProcessor[8080][4]] DEBUG util.BasePeer  - SELECT DISTINCT
PRODUCTS.I
D, PRODUCTS.NAME, PRODUCTS.CATID, PRODUCTS.SUBCATID, PRODUCTS.DESCRIPTION,
PRODU
CTS.PRICE, PRODUCTS.MADEIN, PRODUCTS.INSTOCK, PRODUCTS.DEFAULTPRODUCT,
PRODUCTS.
ACTIVE, PRODUCTS.SHIPPING, PRODUCTS.SHIPPINGADD FROM PRODUCTS WHERE
(PRODUCTS.DE
SCRIPTION = 'shirt' OR PRODUCTS.NAME = 'shirt')

Thanks,
Derick


Mime
View raw message