spring-boot-data-r2dbc-jooq
spring-boot-data-r2dbc-jooq copied to clipboard
`fetchExists` is returning empty `Mono` instead of `Mono` containing `false`
When a query yields records then fetchExists
behaves as expected (returns Mono
containing true
).
However, when there are no records fetchExists
returns an empty Mono
instead of Mono
containing false
.
In particular the code return fetchOne(existsQuery).map(Objects::nonNull)
should be changed to return fetchOne(existsQuery).hasElement()
. A Mono
's element is never null
so .map(Objects::nonNull)
either does nothing (for empty Mono
) or maps to true
.
Thanks for your report. We should fix this misbehaviour with your proposed change.