title: Mybatis XMLGregorianCalendar handler
body: <p>Mapper File
  employeeMapper.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  "http://mybatis.org/dtd/mybatis-3-mapper.dtd"&gt;
  &lt;mapper namespace="com.xxxx.sample.test.dao.TestDAO"&gt;
  &lt;select id="selectEmployee" parameterType="int" resultMap="com.viasat.sample.domain.CreateDate" &gt;
  select createdate from employee where id = #{id}
  &lt;/select&gt;
  &lt;/mapper&gt;
  </code></pre>
  
  <p>Mapper Interface
  TestDAO.java</p>
  
  <pre><code>public interface TestDAO {
  public com.viasat.sample.domain.CreateDate selectEmployee(int id);
  }
  </code></pre>
  
  <p>POJO Bean
  CreateDate.java</p>
  
  <pre><code>public class CreateDate {
  private XMLGregorianCalendar createdate;
  public XMLGregorianCalendar getCreatedate() {
  return createdate;
  }
  public void setCreatedate(XMLGregorianCalendar createdate) {
  this.createdate = createdate;
  }
  }
  </code></pre>
  
  <p>Main Method
  MainClass.java</p>
  
  <pre><code>public class MainClass {
  public static void main(String[] args) {
  SqlSession session = sqlSessionFactory.openSession();
  try {
  TestDAO tm = session.getMapper(TestDAO.class);
  Map emp = tm.selectEmployee(123);
  } catch (Exception e) {
  e.printStackTrace();
  }
  finally {
  session.close();
  }
  }
  }
  </code></pre>
  
  <p>Issue: The date value(createdate) retrieved from is not mapping/setting to XMLGregorianCalendar type createdate in CreateDate bean. It works fine if the data type of createdate is Date. To be brief DATE datatype is not setting in XMLGregorianCalendar type in Mybatis.</p>