Skip to content

Conversation

@62hoon99
Copy link

Summary

Fix IllegalArgumentException: Cannot obtain ColumnInfo for embedded path when using class-based composite IDs as @Id properties.

Problem

When ResolvingRelationalPropertyValueProvider resolves identifiers for entities with composite IDs, it delegates to DocumentValueProvider.getValue() for embedded paths.
Embedded paths do not have a single ColumnInfo, which results in an IllegalArgumentException.

Solution

Update DocumentValueProvider to properly handle embedded paths:

  • getValue(): return null for embedded paths (values are resolved via individual properties)
  • hasValue() / hasNonEmptyValue(): recursively evaluate embedded properties

Changes

  • Updated MappingRelationalConverter.DocumentValueProvider to handle embedded paths correctly
  • Added unit tests for both class-based and record-based composite IDs
  • Added integration tests covering ResolvingRelationalPropertyValueProvider behavior

Testing

All tests pass. Both class-based and record-based composite IDs are now handled correctly.

Fixes #2201

Checklist

  • I have read the Spring Data contribution guidelines.
  • I used the provided code formatters and did not submit formatting-only changes.
  • I added unit and/or integration tests that back my changes.
  • I added myself as author in the headers of the classes I touched and updated the license headers where required.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot obtain ColumnInfo for embedded path

2 participants