title: How to map EnumOrdinalTypeHandler for mybatis-spring-boot?
body: <p>I am now using Mybatis with spring-boot. I didn't add <code>mybatis-config.xml</code>. I make all configurations for datasource and mybatis via <code>application.properties</code> from instructions of 
  <a href="http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/" rel="nofollow noreferrer">mybatis-spring-boot-autoconfigure</a> as below</p>
  
  <pre><code>### Database Configuration
  spring.datasource.url=jdbc:sqlserver://localhost;databaseName=mywebsite;catalogName=mywebsite
  spring.datasource.username=sa
  spring.datasource.password=root
  spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
  
  ### Mybatis Configurations ###
  mybatis.type-aliases-package=com.mycom.myproducts.mywebsite.config.bean
  mybatis.type-handlers-package=org.apache.ibatis.type.EnumOrdinalTypeHandler
  mybatis.mapperLocations=classpath:mybatis/mapper/**/*.xml
  mybatis.configuration.default-fetch-size=100
  mybatis.configuration.default-statement-timeout=30
  </code></pre>
  
  <p>The problem is mybatis can't map for my enum types and the error show </p>
  
  <pre><code>Caused by: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'gender' from result set.  
  Cause: java.lang.IllegalArgumentException: No enum constant com.mycom.myproducts.mywebsite.config.bean.config.UserBean.Gender.0
  </code></pre>
  
  <p>This can be fixed by <code>mybatis-config.xml</code> with</p>
  
  <pre><code>    &lt;typeHandlers&gt;
         &lt;typeHandler handler="org.apache.ibatis.type.EnumOrdinalTypeHandler" javaType="com.mycom.myproducts.mywebsite.config.bean.config.UserBean$Gender"/&gt;
      &lt;/typeHandlers&gt;
  </code></pre>
  
  <p>but I don't know how can this be done by <code>application.properties</code> file ?</p>