jamesfredley opened a new pull request, #15549:
URL: https://github.com/apache/grails-core/pull/15549
## Summary
- Hibernate 7's `SqmCriteriaNodeBuilder.valueParameter()` throws
`HibernateException` when encountering Groovy's `GStringImpl`, unlike Hibernate
5 which silently coerced it
- Added `normalizeValue()` utility method to `PredicateGenerator` that
converts `CharSequence` (including GString) to `String` before passing to JPA
Criteria predicates
- Applied to `Equals`, `NotEquals`, `IdEquals`, `SizeEquals`,
`SizeNotEquals`, and `Between` handlers (`Like`/`ILike` already called
`.toString()`)
- Removed `@PendingFeature` from `MultipleDataSourceConnectionsSpec` - all 4
tests now pass
## Root Cause
The `@PendingFeature` annotation description was misleading - it claimed
`executeQuery` with named parameters failed, but the actual failure was in
`withCriteria` where a Groovy GString (`"The Stand ${UUID.randomUUID()}"`) was
passed as a criteria value. Hibernate 7's strict type checking rejected the
`GStringImpl` type.
The HQL path (`HibernateHqlQuery.populateQueryWithNamedArguments()`) already
handled `CharSequence` correctly at line 295-296.
## Test Results
- **H7**: 2086 tests completed, 17 failed (all pre-existing - 13 require
PostgreSQL, 4 are test isolation issues), 68 skipped
- **H5**: 639 passed, 0 failed
- **Shared modules** (`grails-datastore-core`, `grails-datamapping-core`):
BUILD SUCCESSFUL
## Files Changed
-
`grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/PredicateGenerator.java`
- Added `normalizeValue()`, applied to 6 criterion handlers
-
`grails-data-hibernate7/core/src/test/groovy/org/grails/orm/hibernate/connections/MultipleDataSourceConnectionsSpec.groovy`
- Removed `@PendingFeature` and unused import
--
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]