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
The current singleValue() on the interface ResultQuerySpec expects 1 mandatory result, making confuse to get 0 or 1 results, wich is very common to have a query that returns 1 or 0 results, like this
SELECT somecolumn
FROM sometable
WHERE :somefilter
LIMIT1
If that filter is not meet, the result is empty, and singleValue() is not usefull
This will also help maintain coherence with the single() and optional() methods already provided on MappedQuerySpec.
The text was updated successfully, but these errors were encountered:
vcruzmj
changed the title
JdbcClient ResultQuerySpec - Provide a optionalValue method
JdbcClient ResultQuerySpec - Provide a optionalValue() method
Sep 18, 2024
The current
singleValue()
on the interface ResultQuerySpec expects 1 mandatory result, making confuse to get 0 or 1 results, wich is very common to have a query that returns 1 or 0 results, like thisIf that filter is not meet, the result is empty, and
singleValue()
is not usefullCurrent implementation:
The current implementation can be enhanced by just adding this extra method (using the existing DataAccessUtils method optionalResult.
This will also help maintain coherence with the
single()
andoptional()
methods already provided on MappedQuerySpec.The text was updated successfully, but these errors were encountered: