title: How to get a sorted result in iBatis?
body: <p>I have a table mgr_employee with 2 columns managerName, teamEmployee.<br>Although I do a sort in sql I get unsorted resultMap in java.<br> How can I get a sorted map? Why does iBatis mix up the resultMap? </p>
  
  <pre><code>&lt;resultMap id="s_filter_defaults_ResultMap" class="java.util.HashMap"&gt;
    &lt;result property="key" column="managerName"/&gt;
    &lt;result property="value" column="count"/&gt;
  &lt;/resultMap&gt;
  
  &lt;select id="mCount" parameterClass="java.util.HashMap" resultMap="mcount_ResultMap"&gt;
      &lt;![CDATA[
       select managerName, count(teamEmployee) AS count
        from mgr_employee
        group by managerName 
        order by managerName;
      ]]&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Java code to call the above sql:</p>
  
  <pre><code>Map&lt;String,Long&gt; mCountMap = getSqlMapClientTemplate().queryForMap("mCount", "", "key", "value");
  </code></pre>
  
  <p>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?</p>