mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 16:47:18 +00:00
Merge pull request #1913 from ebean-orm/feature/MaxMin
Change to use @Aggregation as meta annotation - support newly added @Max, @Min, @Avg annotations
This commit is contained in:
@@ -118,7 +118,7 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-annotation</artifactId>
|
||||
<version>6.1</version>
|
||||
<version>6.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -315,11 +315,7 @@ public class AnnotationFields extends AnnotationParser {
|
||||
|
||||
Aggregation aggregation = get(prop, Aggregation.class);
|
||||
if (aggregation != null) {
|
||||
prop.setAggregation(aggregation.value());
|
||||
}
|
||||
Sum sum = get(prop, Sum.class);
|
||||
if (sum != null) {
|
||||
prop.setAggregation("sum(" + prop.getName() + ")");
|
||||
prop.setAggregation(aggregation.value().replace("$1", prop.getName()));
|
||||
}
|
||||
|
||||
Version version = get(prop, Version.class);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.tests.model.aggregation;
|
||||
|
||||
import io.ebean.annotation.Aggregation;
|
||||
import io.ebean.annotation.Max;
|
||||
import io.ebean.annotation.Sum;
|
||||
import io.ebean.annotation.View;
|
||||
|
||||
@@ -24,7 +25,7 @@ public class DMachineStatsAgg {
|
||||
@Aggregation("sum(hours)") // which is the same as: @Sum
|
||||
long hours;
|
||||
|
||||
@Aggregation("max(rate)")
|
||||
@Max
|
||||
BigDecimal rate;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user