TypeHandler with @MappedJdbcTypes
<p>I want to configure a type handler to convert Date columns to LocalDate (Java 8), but I am having trouble registering it. I based my typeHandler on the MyBatis doc and this <a href="https://github.com/javaplugs/mybatis-java-time" rel="nofollow">project</a>.</p>

<p>Mapper:</p>

<pre><code>&lt;resultMap id="clientResult" type="client"&gt;
    &lt;id property="id" column="id" /&gt;
    &lt;result property="name" column="name" /&gt;
    &lt;result property="birthday" column="birthday"  /&gt;
&lt;/resultMap&gt;
</code></pre>

<p>Client class:</p>

<pre><code>public class Client {
    private Long id;
    private String name;
    private java.time.LocalDate birthday;
}
</code></pre>

<p>The type handler:</p>

<pre><code>@MappedJdbcTypes(value = JdbcType.DATE)
public class LocalDateHandler extends BaseTypeHandler&lt;java.time.LocalDate&gt; {
    ...
}
</code></pre>

<p>I get this error on startup:</p>

<pre><code>org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalStateException: No typehandler found for property birthday
</code></pre>

<p>After some debugging and experimenting, I found multiple solutions.</p>

<h3>Solution #1</h3>

<p>Remove <code>@MappedJdbcTypes</code></p>

<h3>Solution #2</h3>

<p>Change the <code>@MappedJdbcTypes</code> annotation to use the undocumented <code>includeNullJdbcType = true</code></p>

<pre><code>@MappedJdbcTypes(value = JdbcType.DATE, includeNullJdbcType = true)
</code></pre>

<h3>Solution #3</h3>

<p>Add a <code>jdbcType</code> to the <code>resultMap</code> property:</p>

<pre><code>&lt;result property="birthday" column="birthday" jdbcType="DATE" /&gt;
</code></pre>

<p>However, I would have expected everything to work as presented above. What's going on? What should I do? </p>

<p>Note: I use MyBatis 3.3.1</p>

<h3>update</h3>

<p>This is considered a bug for now: <a href="https://github.com/mybatis/mybatis-3/issues/591" rel="nofollow">https://github.com/mybatis/mybatis-3/issues/591</a></p>