spring-data-r2dbc
spring-data-r2dbc copied to clipboard
Consider converters for OptionalInt, OptionalLong, and OptionalDouble
Since primitive null values are not emitted as query result (see #469), we should consider adding support for optional primitive projections such as OptionalInt. These types allow reasoning about the target type and their value may be absent while still emitting a result object. This may be required when the result order matters.
interface MyRepository extends ReactiveCrudRepository<MyEntity, Integer> {
@Query("SELECT age FROM my_table ORDER BY first_name")
Flux<OptionalInt> findMaxAge();
}
Can you please assign this issue to me?
For the time being, this ticket should be probably handled in Spring Data Commons to enable other store modules to consume results as OptionalInt etc.