Copilot commented on code in PR #16520:
URL: https://github.com/apache/grails-core/pull/16520#discussion_r4185447989


##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/HibernateQuery.java:
##########
@@ -526,7 +532,8 @@ public Number countResults() {
         Number result;
         if (projections.getProjectionList().isEmpty()) {
             projections().count();
-            result = (Number) executeSingleResult();
+            var creator = createJpaCriteriaQueryCreator();
+            result = (Number) 
getCountQueryExecutor().singleResult(getCurrentSession(), 
creator.createQuery(), creator.getParameterValues());

Review Comment:
   Using `var` requires a sufficiently new Java source level and is atypical in 
mixed Groovy/Java modules where compilation targets may vary. To avoid 
source/target compatibility issues and keep style consistent, consider using an 
explicit type here (e.g., `JpaCriteriaQueryCreator<?> creator = ...`).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to