cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: API for aggregate and non aggregate SQL functions
Date Mon, 09 Jan 2017 12:06:05 GMT

> On Jan 9, 2017, at 4:45 AM, Nikita Timofeev <ntimofeev@objectstyle.com> wrote:
> 
>> 
>> Finally, 'having()' matches the SQL (HAVING is needed for queries on the result of
functions). Have you thought about how that could be abstracted away so that the user can
use where() and the correct SQL is still generated by Cayenne?
>> 
> 
> I can't prove but I think there are some cases when the final result
> depends on whether you use where() or having() on column.

Yes, "having" and "where" are 2 distinct filters. The former filters data before *aggregation*,
the later - after. Aggregation functions operate on the result filtered with "where". No matter
what API we ultimately provide, this distinction is unavoidable, and I'd rather we keep it
explicit.

Andrus
Mime
View raw message