title: Can a query return only part of the results on a resultMap on Ibatis?
body: <p>There is some code using Ibatis 2.3, and I have a class User and a resultMap as follows:</p>
  
  <pre><code>public class User {
    private Integer id;
    private String name;
  
    public Integer getId() {
      return this.id;
    }
  
    public void setId(final Integer id) {
      this.id = id;
    }
  
    public String getName() {
      return this.name;
    }
  
    public void setName(final String name) {
      this.name = name;
    }
  }
  
  &lt;resultMap id="userResultMap" class="user"&gt;
      &lt;result property="id" column="id"/&gt;
      &lt;result property="name" column="name"/&gt;
  &lt;/resultMap&gt;
  </code></pre>
  
  <p>Then I have a select query that only returns the id:</p>
  
  <pre><code>&lt;select id="getUserId" resultMap="userResultMap"&gt;
      select id from Foo
  &lt;/select&gt;
  </code></pre>
  
  <p>Like that, Ibatis wants to fill in all the results on the resultMap and since "name" is not returned by the query it sends and error:</p>
  
  <pre><code>--- The error occurred in ibatis/user.xml.  
  --- The error occurred while applying a result map.  
  --- Check the user.userResultMap.  
  --- Check the result mapping for the 'name' property.  
  --- Cause: java.sql.SQLException: Column 'name' not found.
  </code></pre>
  
  <p>Is it possible somehow to have queries that only return part of the results on a resultMap ?</p>