mybatis - Get HashMap as Result for select -


hi want query database mybatis , want return map

i have daointerface like

public interface idocdao extends ibasicdao {     public map<integer, integer> getdocbya(); } 

and mapper

<select id="getdocbya" resultmap="myhashmap">     select b_id, count(1) count table_a group b_id </select> 

and need return 1 map values, not list of maps

thx. pavel

if want return hashmap, need set resulttype, not resultmap. don't need define myhashmap, hashmap enough.

<select id="getdocbya" resulttype="hashmap">     select b_id, count(1) count table_a group b_id </select> 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -