jamesfredley commented on code in PR #16719:
URL: https://github.com/apache/grails-core/pull/16719#discussion_r4408367730


##########
grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/HqlSelectResultTypeSpec.groovy:
##########
@@ -71,6 +71,29 @@ class HqlSelectResultTypeSpec extends 
HibernateGormDatastoreSpec {
         books*.title == ['Emma', 'Persuasion', 'The Hobbit']
         books.every { it instanceof HqlResultTypeBook }
     }
+
+    void 'executeQuery infers scalar results from a parenthesized root query: 
#hql'() {
+        expect:
+        HqlResultTypeBook.executeQuery(hql).sort() == ['Emma', 'Persuasion', 
'The Hobbit']
+
+        where:
+        hql << [
+                '(select b.title from HqlResultTypeBook b)',
+                '((select b.title from HqlResultTypeBook b))',
+                '( select b.title from HqlResultTypeBook b )',
+                "(select b.title from HqlResultTypeBook b where b.title <> 
')')",
+                '(/* ignore ) and ( */ select b.title from HqlResultTypeBook 
b)',

Review Comment:
   @C:\Users\james\AppData\Local\Temp\reply-hql-tests.txt



-- 
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