Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect mapping for @Embedded entities with @Id queried via NamedParameterJdbcTemplate #1736

Closed
jmrandol opened this issue Feb 7, 2024 · 3 comments
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@jmrandol
Copy link

jmrandol commented Feb 7, 2024

I ran into an issue where I'm querying entities using NamedParameterJdbcTemplate and the mapping logic gets confused. See attached code example.

In 3.1.x, the tests pass. Everything is mapped correctly when querying for PersonPlace entities, but when I attempted an upgrade to 3.2.2, the mapping logic looks to have changed significantly (BasicJdbcConverter to MappingJdbcConverter) and is now trying to incorrectly map the ID fields. Whether this is a bug or I'm doing this way wrong and 3.2.x is revealing that would be nice to know.

test-database.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 7, 2024
@jmrandol
Copy link
Author

Tried to delve into this a little bit. I can't pinpoint exactly where it seems to be going wrong, but at some point the embedded prefix is dropped or ignored when attempting to get the embedded id property from the RowDocument.

@jmrandol
Copy link
Author

@jmrandol
Copy link
Author

This appears to be working again in 3.3.0!

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

No branches or pull requests

3 participants