Files
hibernate-demo/docs/output/21-empty-result-set.txt
T

10 lines
823 B
Plaintext

$ mvn -o -B test -Dtest=AggregateFunctionsTest#emptyResultSet_countIsZero_sumAndAvgAreNull_neitherThrows
(trimmed to the test's own RESULT line and the surefire summary)
RESULT[aggregate-empty-result-set]: over 0 matching rows -- count(p)=0 (never null) | sum(p.price)=null | avg(p.price)=null -- getSingleResult() returned normally for all three, no NoResultException, because SQL's aggregate functions over zero rows still produce exactly one result row.
-------------------------------------------------------------------------------
Test set: com.ankurm.hibernatedemo.aggregate.AggregateFunctionsTest
-------------------------------------------------------------------------------
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.465 s -- in com.ankurm.hibernatedemo.aggregate.AggregateFunctionsTest