Fix RSQL filter in batch update query in assign target group#3107
Merged
strailov merged 5 commits intoJun 2, 2026
Merged
Conversation
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
avgustinmm
reviewed
May 28, 2026
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
vasilchev
reviewed
Jun 1, 2026
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
vasilchev
approved these changes
Jun 1, 2026
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
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.
Refactor assignTargetGroupWithRsql to use a subquery-based approach
(WHERE id IN (SELECT id FROM ... WHERE <rsql_predicate>))instead of applying the RSQL predicate directly to the CriteriaUpdate root.
The NOT EXISTS subquery generated by SpecificationBuilder.notEqualInLike for negated set attribute filters (tag!=, tag=out=) requires JOINs that do not work correctly when attached to an UPDATE root in EclipseLink's UpdateAllQuery. By wrapping the RSQL spec in a SELECT subquery, all JOINs and correlated subqueries execute in a proper SELECT context
Add integration test verifying tag!= filter works correctly
when assigning target groups via RSQL.
Old approach generated the following query :
Which fails in EclipseLink — t.id correlation in the subquery references the UPDATE root, which EclipseLink's UpdateAllQuery can't resolve properly for inherited @id fields.
New Approach :
Also this approach did not work for hibernate, so when using hibernate the old approach is applied.
Meaniong : EclipseLink takes the subquery path (WHERE id IN (SELECT ...))to avoid UpdateAllQuery's @id resolution bug.
While Hibernate takes the direct predicate path for optimal single-statement execution.