Repository navigation
refactor(hibernate7): split HqlQueryContext into QueryParameters and QuerySettings - #16800
Merged
Merged
Conversation
…QuerySettings Extract QueryParameters to encapsulate named and positional parameters, GString query expansion, and parameter value conversion. Extract QuerySettings to manage query arguments and filter JPA hints against AvailableHints. Refactor HqlQueryContext into an immutable record composing the resolved HQL, target class, QueryParameters, QuerySettings, and update/native flags, while preserving compatibility accessors and constructors.
… and deprecate shims Update SelectHqlQuery, MutationHqlQuery, and HqlQueryMethods to consume QueryParameters and QuerySettings directly. Deprecate legacy compatibility accessors and constructors on HqlQueryContext and HqlQueryMethods.
✅ All tests passed ✅🏷️ Commit: 0b4764a Learn more about TestLens at testlens.app/docs. |
jamesfredley
approved these changes
Oct 30, 2026
jamesfredley
left a comment
Contributor
There was a problem hiding this comment.
Query preparation, GString expansion, parameter conversion, and hint filtering stay on the same path after the settings move. SELECT and mutation settings stay separate.
borinquenkid
added a commit
that referenced
this pull request
Nov 3, 2026
…he Groovy sources 8.0.x gained the QueryParameters/QuerySettings split of HqlQueryContext (#16800) and the shared join table list fix (#16756) after this branch was cut from 10.0.x. Their Java sources were converted here by hand: QueryParameters and QuerySettings are new Groovy records, HqlQueryContext, HqlQueryMethods, SelectHqlQuery and MutationHqlQuery follow the 8.0.x change, and the Java SharedJoinTable classes and the specs and docs of those commits apply as they are. A merge of 8.0.x into 10.0.x would otherwise conflict on the deleted Java files; resolve those by keeping the Groovy sources. The ByteBuddyGroovyProxyFactorySpec feature of the proxy-walk commit (#16721) is left out: it needs the grails-datastore-core change of that commit. Claude-Session: https://claude.ai/code/session_01Dmki4SQGwRSj8pRJ5KCWyX
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.
Fixes #16616.
Summary
Extracts
QueryParametersandQuerySettingsfromHqlQueryContextingrails-data-hibernate7, completing the decoupling proposed in #16616 following the introduction ofHqlTextin #16735:QueryParameters:GStringexpansion for both named parameters (:p0,:p1) and positional parameters (?1,?2or native?).CharSequence, collections, and arrays.expand(...)returningExpanded(query, parameters).QuerySettings:max,offset,timeout,flushMode) with defensive copying.AvailableHints.getDefinedHints().StringandHibernateQueryArgumentenum constants.HqlQueryContext:targetClass,QueryParameters,QuerySettings, and update/native flags.namedParams(),positionalParams(),querySettings(),hints()), and static resolution methods with@Deprecated(since = "8.0.1", forRemoval = true).Internal Callers:
SelectHqlQuery,MutationHqlQuery, andHqlQueryMethodsto consumeQueryParametersandQuerySettingsdirectly.HqlQueryMethods.populateParameters(HqlQueryDelegate, QueryParameters)and deprecated the context-based overload.Tests:
QueryParametersSpecandQuerySettingsSpec.