You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A CustomResultSetExtractor should either be instantiated using a constructor with a RowMapper parameter OR using a constructor without any parameters if the RowMapper-constructor doesn't exist:
This does not make sense at all, because the above mentioned RowMapper-constructor is only called it if exists anyways. This prevents injecting the default RowMapper into a custom ResultSetExtractor entirely. It will always be set to null
denniseffing opened DATAJDBC-620 and commented
A
CustomResultSetExtractor
should either be instantiated using a constructor with aRowMapper
parameter OR using a constructor without any parameters if the RowMapper-constructor doesn't exist:https://github.com/spring-projects/spring-data-jdbc/blob/f23b9876429fd33438a06192f2b9b23f49a4d048/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/StringBasedJdbcQuery.java#L143-L170
This functionality is tested using the following unit test: https://github.com/spring-projects/spring-data-jdbc/blob/f23b9876429fd33438a06192f2b9b23f49a4d048/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/query/StringBasedJdbcQueryUnitTests.java#L120-L136
The issue is that the executor of the
StringBasedJdbcQuery
is initialized using arowMapper
set tonull
if therowMapper
equals thedefaultRowMapper
:This does not make sense at all, because the above mentioned RowMapper-constructor is only called it if exists anyways. This prevents injecting the default
RowMapper
into a customResultSetExtractor
entirely. It will always be set to nullAffects: 2.0.4 (Neumann SR4), 2.0.5 (Neumann SR5), 2.1 RC2 (2020.0.0), 2.1 GA (2020.0.0)
Referenced from: pull request #256
The text was updated successfully, but these errors were encountered: