title: iBatis/MyBatis - Get a Map of result instead of a List with custom keys and values
body: <p>Here's my code:</p>
  
  <pre><code>&lt;resultMap class="&lt;custom_class&gt;" id="maptoCustomClass"&gt;
           &lt;result property="idModifiedBy" column="col2" /&gt;
       &lt;result property="assignedTeamName" column="col3" /&gt;
        &lt;/resultMap&gt;
  
        &lt;resultMap class="java.util.HashMap" id="resultMapId"&gt;
           &lt;result property="key" column="col1"/&gt;
       &lt;result property="value" resultMap="file.maptoCustomClass"/&gt;
        &lt;/resultMap&gt;
  
        &lt;select id="fetchTaskTeamAndUser" parameterClass="java.util.HashMap"  resultMap="resultMapId"&gt;
          SELECT col1, col2, col3
          FROM schema_name.table_name
        &lt;/select&gt;
  </code></pre>
  
  <p>This is not working and throwing 'Too many rows returned' error.  I understand why.</p>
  
  <p>My question is how can I fetch the results as a KEY and VALUE pair of a HashMap?</p>
  
  <p>e.g.  I should get one HashMap with key as the value of col1 and values as the object that contains the values of col2 and col3.</p>