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


##########
grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/hibernatequery/PredicateGeneratorSpec.groovy:
##########
@@ -393,6 +394,29 @@ class PredicateGeneratorSpec extends 
HibernateGormDatastoreSpec {
         count == 2L
     }
 
+    def "test getPredicates with EqualsIgnoreCase compares a String property 
in lower case"() {
+        given:
+        new PredicateGeneratorSpecNullableAgeEntity(name: 'Bob', age: 
11).save(failOnError: true)
+        new PredicateGeneratorSpecNullableAgeEntity(name: 'Bobby', age: 
12).save(flush: true, failOnError: true)
+        CriteriaQuery<String> nameQuery = cb.createQuery(String)
+        Root<PredicateGeneratorSpecNullableAgeEntity> nameRoot = 
nameQuery.from(PredicateGeneratorSpecNullableAgeEntity)
+        GrailsHibernatePersistentEntity nullableAgeEntity = 
session.datastore.mappingContext.getPersistentEntity(PredicateGeneratorSpecNullableAgeEntity.name)
 as GrailsHibernatePersistentEntity
+        Predicate[] predicates = predicateGenerator.getPredicates(nameQuery, 
nameRoot, [criterion], new JpaQueryContext(nameRoot), nullableAgeEntity)

Review Comment:
   Non-blocking. This case constructs `EqualsIgnoreCase` and calls 
`PredicateGenerator.getPredicates()` directly, which skips the public query 
surface. The other new tests cover the main equality behavior through the 
criteria DSL, so this does not block approval. Prefer driving these rows 
through the criteria DSL or `HibernateQuery.eqIgnoreCase()`, including a String 
argument against an Integer property so the non-String fallback runs through 
the full pipeline.



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