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
753 stars 345 forks source link

Avoid double-conversion of values considered simple. #1830

Closed odrotbohm closed 2 months ago

odrotbohm commented 2 months ago

MappingJdbcConverter previously tried to create a JdbcValue for simple values via the ConversionService, only to drop the conversion result if the conversion did not result in a JdbcValue eventually. In that case, it triggered an additional (same) conversion to then handle the wrapping of the conversion result into a JdbcValue manually.

This commit alters the flow so that it only triggers the conversion once and manually applies the JdbcValue wrapping only if the result of the original conversion is not a JdbcValue yet.

schauder commented 2 months ago

Thanks. Merged.