borinquenkid opened a new issue, #16811:
URL: https://github.com/apache/grails-core/issues/16811
Split from audit #16804 (finding F13).
### Problem Description
In Hibernate 5, where-query functions such as `Person.where {
upper(lastName) == 'SIMPSON' }` worked as documented in the GORM reference
manual.
In `grails-data-hibernate7`, `PredicateGenerator.handleCriterion()` does not
handle `FunctionCallingCriterion`, throwing `UnsupportedOperationException`.
### Expected Behavior
`PredicateGenerator` should support `FunctionCallingCriterion` by mapping
function names to JPA Criteria expressions:
- `lower` -> `criteriaBuilder.lower()`
- `upper` -> `criteriaBuilder.upper()`
- `trim` -> `criteriaBuilder.trim()`
- `length` -> `criteriaBuilder.length()`
- Other functions -> `criteriaBuilder.function(name, Integer.class, expr)`
And evaluate the resulting expression against the wrapped
`PropertyCriterion` (`equal`, `like`, `ilike`, `gt`, `ge`, `lt`, `le`, `in`).
--
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]