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
After upgrade to org.springframework.data:spring-data-r2dbc:3.2.2, reading converter is executed for generated countBy methods.
In 3.2.1 and before, the converter was not executed as expected
Maybe the fix for #1710 is related.
As a result, the converter fails because it expects to retrieve name column, but only count column is returned:
org.springframework.core.convert.ConversionFailedException: Failed to convert from type [io.r2dbc.postgresql.PostgresqlRow] to type [foo.Foo] for value [io.r2dbc.postgresql.PostgresqlRow@1e52c3ea]
at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:47)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Assembly trace from producer [reactor.core.publisher.FluxHandleFuseable] :
reactor.core.publisher.Flux.handle
io.r2dbc.postgresql.PostgresqlResult.map(PostgresqlResult.java:113)
Error has been observed at the following site(s):
*___________Flux.handle ⇢ at io.r2dbc.postgresql.PostgresqlResult.map(PostgresqlResult.java:113)
*__________Flux.flatMap ⇢ at org.springframework.r2dbc.core.DefaultFetchSpec.lambda$all$1(DefaultFetchSpec.java:78)
*________Flux.usingWhen ⇢ at org.springframework.r2dbc.core.DefaultDatabaseClient.inConnectionMany(DefaultDatabaseClient.java:143)
|_ Flux.onErrorMap ⇢ at org.springframework.r2dbc.core.DefaultDatabaseClient.inConnectionMany(DefaultDatabaseClient.java:155)
|_ ⇢ at org.springframework.r2dbc.core.DefaultFetchSpec.all(DefaultFetchSpec.java:76)
|_ Flux.next ⇢ at org.springframework.r2dbc.core.DefaultFetchSpec.first(DefaultFetchSpec.java:71)
|_ Mono.handle ⇢ at org.springframework.data.r2dbc.core.R2dbcEntityTemplate$UnwrapOptionalFetchSpecAdapter.first(R2dbcEntityTemplate.java:872)
|_ Mono.flatMap ⇢ at org.springframework.data.r2dbc.core.R2dbcEntityTemplate$EntityCallbackAdapter.first
(...)
Caused by: java.util.NoSuchElementException: Column name 'name' does not exist in column names [count]
at io.r2dbc.postgresql.PostgresqlRow.getColumn(PostgresqlRow.java:176)
at io.r2dbc.postgresql.PostgresqlRow.get(PostgresqlRow.java:85)
at foo.FooConverter$ReadConverter.convert(FooConverter.java:44)
The converter should not be called at all for countBy method.
The text was updated successfully, but these errors were encountered:
After upgrade to
org.springframework.data:spring-data-r2dbc:3.2.2
, reading converter is executed for generatedcountBy
methods.In 3.2.1 and before, the converter was not executed as expected
Maybe the fix for #1710 is related.
Sample repository with
countBy
method:Sample reading converter for the entity:
As a result, the converter fails because it expects to retrieve
name
column, but onlycount
column is returned:The converter should not be called at all for
countBy
method.The text was updated successfully, but these errors were encountered: