get Aggregator
Returns an aggregation builder bound to this query and the filters/ constraints derived from spec. Page/pageSize are ignored — aggregations always consider the entire matching set.
Each call returns a fresh aggregator, so callers can build multiple independent chains concurrently without interference.
val total: BigDecimal? = query.getAggregator(spec)
.sum(Order_.total)
.execute<BigDecimal>()
val row: Map<String, Any?> = query.getAggregator(spec)
.sum(Order_.total, "total")
.avg(Order_.total, "average")
.count("*", "cnt")
.execute()Content copied to clipboard