Files
hibernate-demo/docs/output/21-criteria-avg.txt
T

6 lines
473 B
Plaintext

$ mvn -o -B test -Dtest=AggregateFunctionsTest#criteriaApi_avgWithGroupBy_matchesHqlEquivalent
(trimmed to the generated SQL and the test's own RESULT line)
/* <criteria> */ select p1_0.category c0,avg(p1_0.price) c1 from product p1_0 where p1_0.category=? group by c0
RESULT[aggregate-criteria-avg]: Criteria API cb.avg(root.get("price")) for category='Cables' -- average=11.0 -- same numeric result as the equivalent HQL avg(p.price), just built without a string query.