Repository navigation
fix(hibernate7): preserve subquery projections, fail fast on unresolved paths, and filter nulls in inList - #16818
Open
borinquenkid wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Regression coverage is incomplete because invalid-path tests bypass the public query API, and function-wrapped In lacks mixed-null, all-null, empty-list, and numeric-conversion test cases.
2 open issues
What changed in this PR
This PR addresses three Hibernate 7 criteria-translation issues from #16815, building on the scalar-subquery support in #16817.
Changes:
- Copies subquery projections locally and shares subquery construction between handlers.
- Adds descriptive exceptions for unresolved property paths.
- Filters null members from plain and function-wrapped
INcollections, with regression tests for plaininList, projection immutability, and invalid paths.
| File | Description |
|---|---|
grails-data-hibernate7/core/src/test/groovy/grails/orm/HibernateCriteriaBuilderDirectSpec.groovy |
Adds public-query tests for null lists and shared subquery immutability. |
grails-data-hibernate7/core/src/test/groovy/grails/gorm/tests/hibernatequery/PredicateGeneratorSpec.groovy |
Adds translator tests for projections, invalid paths, and null lists. |
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/SubqueryCriterionHandler.java |
Validates property paths and reuses shared subquery construction. |
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/PropertyNameCriterionHandler.java |
Rejects unresolved property paths. |
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/PropertyCriterionHandler.java |
Preserves source projections and handles null or empty IN lists. |
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/PropertyComparisonCriterionHandler.java |
Rejects unresolved paths on either comparison operand. |
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/FunctionCallingCriterionHandler.java |
Filters nulls and handles empty function-wrapped IN lists. |
Review effort: Balanced
borinquenkid
force-pushed
the
fix/h7-scalar-subqueries-comparisons-8.0.x
branch
2 times, most recently
from
November 1, 2026 16:47
25448d5 to
323473b
Compare
…ed paths, and filter nulls in inList - Copy subquery projections into a local ProjectionList in PropertyCriterionHandler and SubqueryCriterionHandler instead of mutating the caller's QueryableCriteria in-place - Throw ConfigurationException when property paths cannot be resolved in PropertyComparisonCriterionHandler, PropertyNameCriterionHandler, and SubqueryCriterionHandler - Filter null elements in In criteria across PropertyCriterionHandler and FunctionCallingCriterionHandler and return a false predicate (disjunction) when no non-null values remain Fixes #16815
borinquenkid
force-pushed
the
fix/h7-criteria-projection-immutability-8.0.x
branch
from
November 1, 2026 16:48
0a5f4fe to
33ee524
Compare
This was referenced Nov 1, 2026
…-projection-immutability-8.0.x
…-criteria-projection-immutability-8.0.x
…unknown properties on H5 and H7 Claude-Session: https://claude.ai/code/session_01Dmki4SQGwRSj8pRJ5KCWyX
…-criteria-projection-immutability-8.0.x
…-projection-immutability-8.0.x Takes the merge of fix/h7-where-query-functions-8.0.x, the review changes of #16816. Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Addresses three criteria translation issues in
grails-data-hibernate7-core:Query.ProjectionListinPropertyCriterionHandler.buildSubquery(and reuses it fromSubqueryCriterionHandler) instead of mutatingQueryableCriteria.getProjections()in-place.ConfigurationExceptioninPropertyComparisonCriterionHandler,PropertyNameCriterionHandler, andSubqueryCriterionHandlerwhen a property path cannot be resolved rather than returningnullpredicates.inList(Query.In): Filtersnullvalues fromQuery.Incollections prior to value conversion and returns a disjunction predicate when no non-null values remain.Fixes #16815