Hi Tom, hi Chris,
attached you find my fix for issue 2725 "JPA qury error: SELECT
COUNT(DISTINCT s) FROM Student s"
(
https://glassfish.dev.java.net/issues/show_bug.cgi?id=2725).
The fix requires a change in method
ReportQuery.prepareObjectAttributeCount, the same method I changed to
fix the other COUNT issue 2497. The old code handled a COUNT aggregate
in the SELECT clause only if the COUNT argument was a QueryKeyExpression
representing a field access. I extended the fix to apply to an
ExpressionBuilder, too. You find the fix and new test cases attached.
Please have a look.
Thanks!
Regards Michael