cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lachlan Deck <>
Subject aggregated queries
Date Sun, 07 Mar 2010 23:08:43 GMT
Hi there,

seeing Andrew Lindesay's recent patch for @size, I'm reminded of a related utility class I've
got that may / may not be useful for Cayenne in general.

It's usage, for examples, is as follows (assuming 'age' is a property of SomeClass):
int avg = new StatsQuery.Avg(SomeClass.class, "age"[, anExpression]).intResult(oc);
int count = new StatsQuery.Count(SomeClass.class[, anExpression]).intResult(oc);
int max = new StatsQuery.Max(SomeClass.class, "age"[, anExpression]).intResult(oc);
int min = new StatsQuery.Min(SomeClass.class, "age"[, anExpression]).intResult(oc);
int sum = new StatsQuery.Sum(SomeClass.class, "age"[, anExpression]).intResult(oc);

Any thoughts on it's inclusion? (e.g., preferred name, package etc)

with regards,

Lachlan Deck

View raw message