0
我有取在MyBatis的结果转换成地图<整数,列表<Integer>>
id | dependencies
----+--------------
1 | {1,2,3,4,5}
2 | {2,3,4,5}
3 | {3,4,5}
4 | {4,5}
5 | {5}
(5 rows)
形式的结果的循环查询我需要这个数据映射到
HashMap<Integer, List<Integer>>,
where
column "id" becomes KEY
column "dependencies" becomes VALUE
(dependencies= postgres array obtained after array_agg)
Apparantly用,的resultSet映射为
@Results(value={
@Result(column="id", property="key", javaType=Integer.class),
@Result(column="dependencies", property="value", typeHandler=ArrayTypeHandler.class)
})
Im getting the results with return type as
List<Map<Integer, List<Integer>>>, but they are not as expected
有没有一种方法,我可以将结果直接映射到地图中?
只是返回Map在您的方法映射也许是正确的,发生了什么?你可以添加更多的信息,因为你得到的结果或类似的东西 –
Pau