criteria.addFilterAutoGroupParentResourceId(context.parentResourceId);
criteria.addFilterAutoGroupResourceTypeId(context.resourceTypeId);
}
criteria.setSupportsAddSortId(false);
CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria);
String replacementSelectList = "" //
+ " new org.rhq.core.domain.measurement.calltime.CallTimeDataComposite( " //
+ " calltimedatavalue.key.callDestination, " //
+ " MIN(calltimedatavalue.minimum), " //
+ " MAX(calltimedatavalue.maximum), " //
+ " SUM(calltimedatavalue.total), " //
+ " SUM(calltimedatavalue.count), " //
+ " SUM(calltimedatavalue.total) / SUM(calltimedatavalue.count) ) ";
generator.alterProjection(replacementSelectList);
generator.setGroupByClause("calltimedatavalue.key.callDestination");
if (authorizationManager.isInventoryManager(subject) == false) {
generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
"key.schedule.resource", subject.getId());
}
//log.info(generator.getParameterReplacedQuery(false));
//log.info(generator.getParameterReplacedQuery(true));