5

For the below query,

 SELECT 
     MSGS.MSGTYPE,
     count(*) as NOOFRECORDS 
 FROM 
     SCHEMA.MESSAGES MSGS
 GROUP BY 
     MSGS.MSGTYPE

What would be the equivalent in MyBatis mapper so that I can get a Result as a HashMap with MSGS.MSGTYPE as the key and NOOFRECORDS as the value ?

Sled
  • 18,541
  • 27
  • 119
  • 168
V R
  • 104
  • 1
  • 1
  • 10
  • I got a good reference here so i guess i have my answer http://stackoverflow.com/questions/11913013/return-hashmap-in-mybatis-and-use-it-as-modelattribute-in-spring-mvc – V R Nov 13 '14 at 21:38

1 Answers1

15
<select id="selectAllCategories" resultType="hashmap">
 select id, name from categories  
</select>

and More details here

Stack Answer

Community
  • 1
  • 1
V R
  • 104
  • 1
  • 1
  • 10