Consistent Object result declarations for ResultQuerySpec
Closes gh-31403
This commit is contained in:
@@ -285,10 +285,9 @@ final class DefaultJdbcClient implements JdbcClient {
|
||||
return classicOps.queryForMap(sql, indexedParams.toArray());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> List<T> singleColumn() {
|
||||
return (List<T>) classicOps.queryForList(sql, Object.class, indexedParams.toArray());
|
||||
public List<Object> singleColumn() {
|
||||
return classicOps.queryForList(sql, Object.class, indexedParams.toArray());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,10 +309,9 @@ final class DefaultJdbcClient implements JdbcClient {
|
||||
return namedParamOps.queryForMap(sql, namedParamSource);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> List<T> singleColumn() {
|
||||
return (List<T>) namedParamOps.queryForList(sql, namedParamSource, Object.class);
|
||||
public List<Object> singleColumn() {
|
||||
return namedParamOps.queryForList(sql, namedParamSource, Object.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -323,17 +323,16 @@ public interface JdbcClient {
|
||||
* Retrieve a single column result,
|
||||
* retaining the order from the original database result.
|
||||
* @return a (potentially empty) list of rows, with each
|
||||
* row represented as a column value of the given type
|
||||
* row represented as its single column value
|
||||
*/
|
||||
<T> List<T> singleColumn();
|
||||
List<Object> singleColumn();
|
||||
|
||||
/**
|
||||
* Retrieve a single value result.
|
||||
* @return the single row represented as its single
|
||||
* column value of the given type
|
||||
* @return the single row represented as its single column value
|
||||
* @see DataAccessUtils#requiredSingleResult(Collection)
|
||||
*/
|
||||
default <T> T singleValue() {
|
||||
default Object singleValue() {
|
||||
return DataAccessUtils.requiredSingleResult(singleColumn());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user