ruthst00 commented on code in PR #16573:
URL: https://github.com/apache/grails-core/pull/16573#discussion_r4362653050
##########
grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/BasicCollectionInQuerySpec.groovy:
##########
@@ -139,17 +139,22 @@ class BasicCollectionInQuerySpec extends Specification {
s3.addToSchools("Columbia")
s3.save(flush: true)
- when: "an alias is explicitly created before using in() with the raw
property name"
+ when: "an alias is explicitly created before restricting the
collection or the alias"
def results = BcStudent.createCriteria().list {
createAlias("schools", "sch")
- 'in'('schools', ['Princeton'])
+ 'in'(restrictedPath, ['Princeton'])
projections {
property 'email'
}
}
- then: "the existing alias is reused instead of creating a duplicate"
- results.sort() == ['[email protected]', '[email protected]']
+ then: "collection membership leaves the alias independent, while an
alias restriction filters its elements"
+ results.sort() == expectedEmails
+
+ where:
+ restrictedPath | expectedEmails
+ 'schools' | ['[email protected]', '[email protected]', '[email protected]']
Review Comment:
Fixed in
https://github.com/apache/grails-core/pull/16573/changes/5eff154bbb77d01a3184bfde65994a543f2b4faa,
https://github.com/apache/grails-core/pull/16573/changes/735e492162162edb0305ffb368598bfce99a5bcf
--
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]