Class CriteriaAggregateQueryBuilder

All Implemented Interfaces:
AggregateQueryBuilder, QueryBuilderBase<AggregateQueryBuilder, AggregateQueryWrapper>

public class CriteriaAggregateQueryBuilder extends AbstractCriteriaBuilder<AggregateQueryBuilder, Object[], AggregateQueryWrapper> implements AggregateQueryBuilder
A criteria builder that calculates all its Aggregate with a single query. The aggregates are calculated by the database, therefore the permissions of an aggregated field cannot be evaluated per row afterwards (normally done by SecureQueryInterceptor.SecureSelectionInterceptor#handlePermissions, which nullifies the value of a field the current user may not read). The QueryBuilderInterceptor are therefore called manually, and their conditions are applied to the aggregated expression itself (sum(case when <condition> then <field> end)) instead of the where clause: aggregate functions ignore null values, so every aggregate keeps its own row filter even though all of them share one query. A field that may not be used in a query at all (privileged access only) is rejected by the interceptor itself.