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


##########
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:
   Thanks, moved these rows to `HibernateQuerySpec` (through 
`HibernateQuery.eqIgnoreCase()`) and dropped the `PredicateGeneratorSpec` 
feature. Added a `String` value against an `Integer` property there and through 
the criteria DSL in `HibernateCriteriaBuilderDirectSpec`, so the non-`String` 
fallback now 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