title: Mybatis resultmap to map values to hash map field of a model
body: <p>I am trying to map create a result map that will populate vehicleVO. I want to map few columns to vehicleDocuments HashMap. I am having the data to be populated also present in the same table.</p>
  
  <pre><code>public class VehicleVO implements Serializable {
      public String vehicleId;
      public String vehicleNumber;
      public String model;
      public Map&lt;String, Date&gt; vehicleDocuments;
      public TransportVO transport;
      public String distanceTraveled;
  
  }
  </code></pre>
  
  <p>I am trying to use the following xml for mapping. But it don't seem to work. I a gettign this error </p>
  
  <blockquote>
    <p>"The content of element type "resultMap" must match
    "(constructor?,id*,result*,association*,collection*,discriminator?)".</p>
  </blockquote>
  
  
  
  <pre><code>&lt;resultMap id="BaseResultMap" type="com.svms.service.vo.VehicleVO"&gt;
          &lt;id column="vehicle_id" jdbcType="BIGINT" property="vehicleId" /&gt;
          &lt;result column="vehicle_no" jdbcType="VARCHAR" property="vehicleNumber" /&gt;
          &lt;result column="Model" jdbcType="VARCHAR" property="model" /&gt;
          &lt;association property="vehicleDocuments" javaType="java.util.HashMap"&gt;
              &lt;result column="FC" jdbcType="DATE" property="FC_TD" /&gt;
              &lt;result column="TAX" jdbcType="DATE" property="TAX_TD" /&gt;
              &lt;result column="Insureance" jdbcType="DATE" property="INSURANCE_TD" /&gt;
              &lt;result column="Form47" jdbcType="DATE" property="FORM47_TD" /&gt;
              &lt;result column="NC" jdbcType="DATE" property="NC_TD" /&gt;
          &lt;/association&gt;
          &lt;result column="total_distance" jdbcType="INTEGER" property="distanceTraveled" /&gt;
          &lt;result column="transport_id" jdbcType="BIGINT" property="transportId" /&gt;
  &lt;/resultMap&gt;
  </code></pre>
  
  <p>If my understanding is correct, Trying to map to an hashMap can also be considered as association mapping. But this is a one to one mapping only. I also tried using the <code>&lt;collection&gt;</code> tag for mapping. Still I get the same error.</p>