title: How to change value(null to empty string) from query when using mybatis?
body: <p>I am doing a project which uses Spring 3.1.1 and MyBatis3.0.</p>
  
  <p>I am trying to change iBatis to MyBatis. However, I am struggling with resultmap.</p>
  
  <p>When using iBatis, I can handle values from query like below with 'nullValue'. </p>
  
  <pre><code>&lt;resultMap class="java.util.HashMap" id="ChannelData"&gt;
          &lt;result property="id"       javaType="java.lang.String"         column="CHANNEL_ID" nullValue=""/&gt;
          &lt;result property="code"         column="SELECTSCOPE"        nullValue="Television"/&gt;
  &lt;/resultMap&gt;
  </code></pre>
  
  <p>The problem is there no 'nullValue' in MyBatis. In addition, if the column is 'null' then mybatis never fills that element. for Example. if 'SELECTSCOPE' is null, it brings <code>{id=aaa}</code>. I need some data like this --> <code>{id=aaa, code=''}</code>. Is there anyway to handle this?</p>
  
  <p>P.S.</p>
  
  <p>I queries more than 20 columns. Some of them need "" when value is null, others has own default some string value.(If I use iBatis, 'nullValue' is magic keyword) I found some links which recommend to use customized type handler, but making handler more than 20 can be cause of future confusion to repair or maintaining. I need some simple way.</p>
  
  <p>Thanks a lot:D</p>
  
  <p>======================================================================================</p>
  
  <p>I found the way to bring some null values. It needs some configuration.</p>
  
  <ul>
  <li>make config.xml, which should contain some information about MyBatis Config DTD and Settings like below</li>
  </ul>
  
  <blockquote>
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD SQL MAP Config 3.1//EN" 
  "http://mybatis.org/dtd/mybatis-3-config.dtd"&gt;
  &lt;configuration&gt;
    &lt;settings&gt;
        &lt;setting name="callSettersOnNulls" value="true"/&gt;
    &lt;/settings&gt;
  &lt;/configuration&gt;
  </code></pre>
  </blockquote>
  
  <p>now, I can get <code>{id="aaa", code = null}</code>. Here is additional question. How can I set default values for query? for example. if value of 'code' is null, then I want to put default String 'default'. So result should change form 
  <code>{id="aaa", code=null}</code> to <code>{id="aaa",code="default"}</code>. Is it possible?</p>
  
  <p>Thanks~ </p>