Closed
Description
It would be nice to have a simple built-in way top map two-column result set to a Map
. Just like mapping single-column results to List
or Set
.
Currently, my options either to create a DTO and then manually do result.stream().collect(toMap(Dto::getId, Dto::getCount))
or use @MapKey("id")
and Map<Long, Dto>
or use ResultHandler
, which is basically the same as streams but ugly, though it does not allocate unnecessary instances of Dto
class.
At least that's the options I've found on google so far. I mean, it is quite a common issue.
Are there any limitations that make it impossible to implement such mapping as a built-in feature?
Metadata
Metadata
Assignees
Labels
No labels