spring-projects / spring-data-relational

Spring Data Relational. Home of Spring Data JDBC and Spring Data R2DBC.
https://spring.io/projects/spring-data-jdbc
Apache License 2.0
757 stars 345 forks source link

Re-occuring issue: One-to-many relation: ResultSet contains ... multiple times #1865

Closed amundsor closed 2 weeks ago

amundsor commented 2 weeks ago

I dont know if this has been the case all the way, or if it is just the logging which are stricter. After we upgraded to lastest version of Spring we are getting alot of: "One-to-many relation: ResultSet contains ... multiple times" This comes from RowDocumentResultSetExtractor#79. log.warn(DUPLICATE_COLUMN_WARNING, columnName, i);

We have a class Family containing children: Map<UUID, Child> where the family_key is also a member of the Child-object. There are ofcourse multiple ways to solve this, but from the top of my head I don't think this should create a warning.

Perhaps there is a good reason for it to work this way ?

amundsor commented 2 weeks ago

Has been flagged before: Github Issue

schauder commented 2 weeks ago

Do you still have this issue in 3.x?

If so, please provide a Minimimal Reproducable Example, preferable as a Github repository. Make sure to include the database, either as an in memory database or if that is not possible using Testcontainers.

schauder commented 2 weeks ago

I was able to create a reproducer. Will investigate.