public AggregationFunction getAggregationType() { return propertyPath.getAggregationFunction(); }
private PropertyPath<TypeDescriptor<TypeMetadata>> resolveAlias(PropertyPath<TypeDescriptor<TypeMetadata>> path) { List<PropertyPath.PropertyReference<TypeDescriptor<TypeMetadata>>> resolved = resolveAliasPath(path); return path instanceof AggregationPropertyPath ? new AggregationPropertyPath<>(((AggregationPropertyPath) path).getAggregationFunction(), resolved) : new PropertyPath<>(resolved); }
@Override public String toString() { return aggregationFunction.name() + "(" + asStringPath() + ")"; } }
@Override public int hashCode() { return propertyPath.hashCode(); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AggregationExpr other = (AggregationExpr) o; return propertyPath.equals(other.propertyPath); }
throw log.getAggregationCanOnlyBeAppliedToPropertyReferencesException(aggregationFunction.name()); propertyPath = new AggregationPropertyPath<>(aggregationFunction, propertyPath.getNodes());
@Override public String toString() { return propertyPath.getAggregationFunction().name() + "(" + super.toString() + ")"; }
@Override public String toQueryString() { return propertyPath.getAggregationFunction().name() + "(" + super.toQueryString() + ")"; }
FieldAccumulator acc = FieldAccumulator.makeAccumulator(((AggregationPropertyPath) p).getAggregationFunction(), c.getColumnIndex(), c.getColumnIndex(), c.getPropertyType()); if (propertyHelper.isRepeatedProperty(parsingResult.getTargetEntityMetadata(), p.asArrayPath())) { secondPhaseAccumulators.add(acc); if (((AggregationPropertyPath) p).getAggregationFunction() == AggregationFunction.COUNT) { c = new RowPropertyHelper.ColumnMetadata(c.getColumnIndex(), c.getColumnName(), Long.class); acc = FieldAccumulator.makeAccumulator(AggregationFunction.SUM, c.getColumnIndex(), c.getColumnIndex(), Long.class);
FieldAccumulator acc = FieldAccumulator.makeAccumulator(((AggregationPropertyPath) p).getAggregationFunction(), c.getColumnIndex(), c.getColumnIndex(), c.getPropertyType()); if (propertyHelper.isRepeatedProperty(parsingResult.getTargetEntityMetadata(), p.asArrayPath())) { secondPhaseAccumulators.add(acc); if (((AggregationPropertyPath) p).getAggregationFunction() == AggregationFunction.COUNT) { c = new RowPropertyHelper.ColumnMetadata(c.getColumnIndex(), c.getColumnName(), Long.class); acc = FieldAccumulator.makeAccumulator(AggregationFunction.SUM, c.getColumnIndex(), c.getColumnIndex(), Long.class);
Class<?> propertyType = FieldAccumulator.getOutputType(((AggregationPropertyPath) p).getAggregationFunction(), parsingResult.getProjectedTypes()[i]); int idx = columns.size(); columns.put(p, new RowPropertyHelper.ColumnMetadata(idx, "C" + idx, propertyType)); FieldAccumulator acc = FieldAccumulator.makeAccumulator(((AggregationPropertyPath) p).getAggregationFunction(), inIdx, c.getColumnIndex(), c.getPropertyType()); accumulators.add(acc);
Class<?> propertyType = FieldAccumulator.getOutputType(((AggregationPropertyPath) p).getAggregationFunction(), parsingResult.getProjectedTypes()[i]); int idx = columns.size(); columns.put(p, new RowPropertyHelper.ColumnMetadata(idx, "C" + idx, propertyType)); FieldAccumulator acc = FieldAccumulator.makeAccumulator(((AggregationPropertyPath) p).getAggregationFunction(), inIdx, c.getColumnIndex(), c.getPropertyType()); accumulators.add(acc);