> From: John McNally <[EMAIL PROTECTED]>
> 
> Criteria crit = new Criteria();
> crit.addSelectColumn("count(*)");
> ... add more stuff to crit ...
> List records = FooPeer.doSelectVillageRecords(crit);
> int count = ((Record)records.get(0)).getValue(1).asInt();

The code above will result in a TorqueException from
BasePeer.createQueryString() as this checks that all select columns include
a period.

A workaround is to not use "count(*)", but rather some column that exists in
the table (e.g. "count(TABLE.TABLE_ID)").

The attached patch to BasePeer allows select columns that contain an
asterisk through and thus the "count(*)" will be available.  I am unsure
however if this have any adverse effects elsewhere?  Anyone care to comment?

Cheers,

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


Attachment: BasePeer.diff.txt
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to