title: When to add a scalar to a named query
body: <p>When is it necessary to add a scalar to a named query?e.g:</p>
  
  <pre><code>&lt;return-scalar column="colName" type="java.lang.String" /&gt; 
  </code></pre>
  
  <p>Sometimes they seem to be not needed, while sometimes, without the scalar, the query will throw exception. </p>