title: MyBatis maps the attribute to the wrong Enum
body: <p>My domain class has attributes mapped to an enum. Strangely MyBatis 3.4.x (Both 3.4.0 and 3.4.4. This worked with 3.3.x) with Spring MyBatis 1.3.1 tries to map it with an unrelated enum and gives the error.</p>
  
  <blockquote>
    <p>org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'order_line_programmed' from result set.  Cause: java.lang.IllegalArgumentException: No enum constant foo.UnrelatedEnum.yes</p>
  </blockquote>
  
  <p>My domain class looks like this:</p>
  
  <pre><code>public class OrderLine {
  
      private Long id;
      private Product product;
      private ProgrammedStatus programmedStatus;
      private String programmedFeedback;
      private boolean completed = false;
  }
  </code></pre>
  
  <p>ProgrammedStatus is a simple enum</p>
  
  <pre><code>public enum ProgrammedStatus {
      yes, no, error;
  }
  </code></pre>
  
  <p>It is this programmedStatus which is mapped to programmed column as follows,</p>
  
  <pre><code>&lt;resultMap id="orderLineResult" type="foo.OrderLine"&gt;
      &lt;id property="id" column="technical_order_line_id" /&gt;
      &lt;result property="programmedStatus" column="order_line_programmed" typeHandler="org.apache.ibatis.type.EnumTypeHandler" /&gt;
      &lt;result property="programmedFeedback" column="order_line_programmed_feedback" /&gt;
      &lt;result property="completed" column="order_line_completed"
          javaType="java.lang.Boolean" typeHandler="org.apache.ibatis.type.BooleanTypeHandler" /&gt;
      &lt;association property="product"
          notNullColumn="order_line_product_id"
          resultMap="foo.repository.mapper.ProductMapper.productResult" /&gt;
  &lt;/resultMap&gt;
  </code></pre>
  
  <p>I even tried mapping the javaType with the typeHandler, but MyBatis seem to ignore it.</p>
  
  <p>Few information which may find useful,</p>
  
  <ul>
  <li>UnrelatedEnum is also a simple Enum as ProgrammedStatus</li>
  <li>Product has an attribute which has an attribute which is of type UnrelatedEnum</li>
  </ul>
  
  <p>I found this issue in other places of code as well. I COULD have my own specific typeHandler instead of the EnumTypeHandler here. The issue is that this enum matching is used in a lot of places in my program and migrating wit 3.4 makes my program unstable.</p>