开发者

Return a Single Map in IBATIS

开发者 https://www.devze.com 2023-01-23 01:11 出处:网络
I have a SqlMap query that returns 2 columns, an ID and a string.I know how to return a list of maps where the ID is the key and the string is the value.There is one list item for each row returned.

I have a SqlMap query that returns 2 columns, an ID and a string. I know how to return a list of maps where the ID is the key and the string is the value. There is one list item for each row returned.

How can I return 1 map with t开发者_运维技巧he IDs as keys and strings as values?


You have to use resultType as Map and if query is returning mutilple rows then in DAO you need to handle it using List<Map<String,Object>>

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号