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.
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.