I have a table mgr_employee with 2 columns managerName, teamEmployee.
Although I do a sort in sql I get unsorted resultMap in java.
How can I get a sorted map? Why does iBatis mix up the resultMap?
<resultMap id="s_filter_defaults_ResultMap" class="java.util.HashMap">
<result property="key" column="managerName"/>
<result property="value" column="count"/>
</resultMap>
<select id="mCount" parameterClass="java.util.HashMap" resultMap="mcount_ResultMap">
<![CDATA[
select managerName, count(teamEmployee) AS count
from mgr_employee
group by managerName
order by managerName;
]]>
</select>
Java code to call the above sql:
Map<String,Long> mCountMap = getSqlMapClientTemplate().queryForMap("mCount", "", "key", "value");
mCountMap is not sorted as was expected due to the "order by" clause in the sql. Any comments/suggestion, how to get the resultMap sorted?