probably something super simple. I'd like to retrieve two sets of key (String) and value(double) from a simple query which returns one row with two columns.
There must be a cleaner way to do it than what I have below - that's 10 lines to get the job done, which seems overkill. Any recommendation what to use instead? Thanks!
List<Map<String, Double>> RecordList = namedParameterJdbcTemplate.query(Queries.GET_DATASET(),
getParsedQuery(request), resultSet -> {
List<Map<String, Double>> list = new ArrayList();
HashMap mMap = new HashMap();
mMap.put("this_year", resultSet.getDouble("this_year"));
list.add(mMap);
mMap = new HashMap();
mMap.put("last_year", resultSet.getDouble("last_year"));
list.add(mMap);
return list;
});