title: How to make the myBatis select result(list) be set to object's property?
body: <p>Generally, myBatis's select method returns single object or generic List types. for example, I want to fetch all students of a class:</p>
  
  <pre><code>&lt;select id="fetchStudentsOfClass" parameterType="int" resultMap="resultMapStudent"&gt;
      SELECT * FROM students WHERE class_id=#{id}
  &lt;/select&gt;
  </code></pre>
  
  <p>I can easily get a result like this: <code>List&lt;Student&gt;</code>.</p>
  
  <p>Now, if I want to get the result like this rather than <code>List&lt;Student&gt;</code>:</p>
  
  <pre><code>class MyClass
  {
      List&lt;Student&gt; getStudents{return this.students;}
      void setStudents(List&lt;Student&gt; students){this.students = students}
      private List&lt;Student&gt; students;
  }
  </code></pre>
  
  <p>how can I do?</p>