title: Dealing with nulls when selecting in MyBatis
body: <p>I have a query which at first launch returns zero rows:</p>
  
  <pre><code>&lt;select id="getParams" parameterType="map" resultMap="ParamsResultMap"&gt;
      SELECT ID, GROUPS, TEMPLATES, DATE_FROM, DATE_TO
      FROM MY_FILTERS 
      WHERE ID = #{id}
  &lt;/select&gt;
  
  &lt;resultMap id="ParamsResultMap" type="my.domain.ParamsVO"&gt;
      &lt;result column="ID" property="id"/&gt;
      &lt;result column="GROUPS" property="groups"/&gt;
      &lt;result column="TEMPLATES" property="templates"/&gt;
      &lt;result column="DATE_FROM" property="dateFrom" jdbcType="TIMESTAMP"/&gt;
      &lt;result column="DATE_TO" property="dateTo" jdbcType="TIMESTAMP"/&gt;
  &lt;/resultMap&gt;
  </code></pre>
  
  <p>It is ok as I want to manage it in java:</p>
  
  <pre><code>ParamsVO params = myRepository.getParams(id);
  if (params == null) {
      ...
  }
  </code></pre>
  
  <p>But I am getting exception:</p>
  
  <pre><code>org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #4 with JdbcType OTHER . 
  Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. 
  Cause: java.sql.SQLException: Invalid column type ; uncategorized SQLException for SQL []; 
  SQL state [null]; error code [17004]; 
  </code></pre>
  
  <p>I've tried with <code>jdbcType = "DATE"</code> and without jdbcType with similar results.</p>
  
  <p>My question is which is correct way to deal with queries which returns zero rows at MyBatis?</p>