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
740 stars 342 forks source link

Fix access of root property instead of child property #1775

Closed schauder closed 3 months ago

schauder commented 3 months ago

When the child of a one-to-one relationship has an id, the value for that id gets read in the wrong way. We get the column name for that id use that to access the value in the RowDocument.

This results in either no value at all being found or even worse, the value of a root entity with a property of same name being accessed.

This is fixed by using the full AggregatePath instead of just the property for accessing that value.

Closes https://github.com/spring-projects/spring-data-relational/issues/1684