Skip to content

Fix target group assignment with RSQL negation filters (e.g. tag!=tag…#3116

Merged
strailov merged 4 commits into
eclipse-hawkbit:masterfrom
boschglobal:fix/assign_target_groups_with_rsql_against_mysql
Jun 8, 2026
Merged

Fix target group assignment with RSQL negation filters (e.g. tag!=tag…#3116
strailov merged 4 commits into
eclipse-hawkbit:masterfrom
boschglobal:fix/assign_target_groups_with_rsql_against_mysql

Conversation

@strailov

@strailov strailov commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

…1) failing on EclipseLink/MySQL

  • EclipseLink's UpdateAllQuery cannot handle NOT EXISTS subqueries with inherited @id from @MappedSuperclass — generates invalid SQL (cross-join, missing ManyToMany join table)
  • When RSQL contains negation (!=, =out=, =notlike=), use chunked SELECT+UPDATE approach that bypasses the EclipseLink bug
  • Positive RSQL filters continue using the direct single-query CriteriaUpdate path
  • Chunk size configurable via hawkbit.target-group.assign.chunk-size (default: 1000)

…1) failing on EclipseLink/MySQL

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
@strailov strailov requested a review from avgustinmm June 4, 2026 13:22
strailov added 2 commits June 5, 2026 09:25
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
// BUG Reported: https://github.com/eclipse-ee4j/eclipselink/issues/2757
// Hibernate: applies predicate directly to the UPDATE root — Hibernate handles
// NOT EXISTS subqueries correctly in CriteriaUpdate context. So this problem does not exist there.
if (containsNegation(rsql)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (containsNegation(rsql)) {
if (Jpa.JPA_VENDOR == Jpa.JpaVendor.ECLIPSELINK && containsNegation(rsql)) {


List<Long> chunk;
int offset = 0;
final int CHUNK_SIZE = assignTargetGroupChunkSize;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHUNK_SIZE -> chunkSize, and it's not actually needed - you could use assignTargetGroupChunkSize directly

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
@strailov strailov merged commit 9568096 into eclipse-hawkbit:master Jun 8, 2026
6 checks passed
@strailov strailov deleted the fix/assign_target_groups_with_rsql_against_mysql branch June 8, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants