The field constants usually include the tablename. (usually you'll be able to find a column as
a substitute for the * sign).
Maurice Wijtten
Amit Rana wrote:
Use criteria.addSelectColumn("count(*)"); to add count(*) Use tablePeer. doSelectVillageRecords(criteria) to retrieve records
then you can fetch the value from the list.
HTH
contains-----Original Message----- From: Michael Burschik [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2003 6:31 PM To: [EMAIL PROTECTED] Subject: Problems with Criteria and ORDER BY
The BasePeer.createQuery method checks whether the order by column
a "." and throws an exception if it does not. This is not a very goodidea.
First of all, it does not catch non-existent column names that happento
include a ".". And secondly, it does not allow for the perfectly legaluse
of a column alias in the order by statement, e.g. "select somecolumn,to get
count(*) as count from mytable order by count". Is there another way
this, apart from the obvious solution of building the statementmanually?
Regards
Michael Burschik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
