Skip to content

Fix upsert update columns for embedded identifiers - #2331

Closed
leewoo97 wants to merge 1 commit into
spring-projects:mainfrom
leewoo97:issue/2313
Closed

Fix upsert update columns for embedded identifiers#2331
leewoo97 wants to merge 1 commit into
spring-projects:mainfrom
leewoo97:issue/2313

Conversation

@leewoo97

Copy link
Copy Markdown
Contributor
  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Fixes #2313

R2dbcEntityTemplate upsert now derives update columns from the mapped OutboundRow columns and excludes identifier and insert-only columns. This prevents embedded id property names from being rendered in DO UPDATE SET.

Tested with:

./mvnw -pl spring-data-r2dbc clean test -Dtest=ReactiveUpsertOperationUnitTests

Signed-off-by: leewoo97 <dldnwls009@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 21, 2026
@schauder schauder added the type: bug A general bug label Jul 22, 2026
@schauder schauder self-assigned this Jul 22, 2026
@schauder schauder removed the status: waiting-for-triage An issue we've not yet triaged label Jul 22, 2026
schauder pushed a commit that referenced this pull request Jul 22, 2026
Signed-off-by: leewoo97 <dldnwls009@gmail.com>

Closes #2313
Original pull request #2331
schauder pushed a commit that referenced this pull request Jul 22, 2026
Signed-off-by: leewoo97 <dldnwls009@gmail.com>

Closes #2313
Original pull request #2331
@schauder

Copy link
Copy Markdown
Contributor

Thanks. I fixed the @author tags to use your name instead of the Github handle.

This is merged and back ported

@schauder schauder closed this Jul 22, 2026
@schauder schauder added this to the 4.1.1 (2026.0.1) milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

R2dbcEntityTemplate.upsert() generates invalid SQL for entities with @Embedded.Empty composite primary keys

3 participants