db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Eade <se...@backstagetech.com.au>
Subject Re: Criteria with a like
Date Sat, 28 Feb 2004 02:21:12 GMT
Rob Broadhead wrote:

> I am doing a select with a like as shown below and I have to enter the 
> column name as a string instead of using the static member of the 
> peer. If I use the member then it builds the sql to find 
> tablename.tablename.columnname instead of tablename.columnname is this 
> me using the API incorrectly or is it something I set wrong when 
> generating the peers? I am using torque 3.1 with Postgres if that helps.
>
> String name = "test client%";
> Criteria crit = new Criteria;
> crit.add(ClientsPeer.TABLE_NAME,"CLIENTNAME",name,Criteria.LIKE); // 
> works
>
> // 
> crit.add(ClientsPeer.TABLE_NAME,ClientsPeer.CLIENTNAME,name,Criteria.LIKE); 
> // does not work

Try:

    crit.add(ClientsPeer.CLIENTNAME, name, Criteria.LIKE);

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



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