On 04/06/2007, at 5:40 PM, Andrus Adamchik wrote:
It'd be worth adding support for not only count but avg, max, min,
sum operations on keys... like: [EMAIL PROTECTED]
Sure, but my point was that query should not run itself. Hence the
separation between the query and its execution logic.
Maybe the class I posted beforehand could be easily morphed into
such a query helper(?).
Yes - in defining CountQuery, MaxQuery, etc. it seems like what we
need.
I think the query needs to return 1 object in the list of results
which is a Number rather than returning a Map where there's an
element with key 'C' (which is fine for sql template operations
but I'd have thought the point of a stats helper would be to
abstract that kind of stuff.
I was thinking that DataObjectUtils.intValueForQuery proposed below
would do the unwrapping of the map into a scalar value. It can do
it in a generic fashion as long as there's only one key in the
returned map.
Great. Will the DataObjectUtils.intValueForQuery work with 3 tier also?
with regards,
--
Lachlan Deck