title: ArrayList Mapping in IBatis
body: <p>How should I map multiple columns with List in IBATIS ?</p>
  
  <p>I have a Bean, say :</p>
  
  <pre><code>public class AttendanceBean {
      private String user_id;
      private String user_name;
      private List daysArray;
      // setter/getter methods
  }
  </code></pre>
  
  <p>Ibatis (select clause in sqlMap):</p>
  
  <pre><code>&lt;select id="someName" parameter="param"&gt;
     select user_id,user_name,
          day_1,
          day_2,
          day_3,
           ...
           ...
          day_31
      from table1,table2 
      where table1.userid=table2.userid
  &lt;select&gt;
  </code></pre>
  
  <p>My question is how I am going to Map AttendanceBean's daysArray with columns <code>day_1</code>, <code>day_2</code>, ... <code>day_31</code> in <code>ResultMap</code> even though I can simply write JDBC code for this as follows:</p>
  
  <pre><code>List alluser = new ArrayList();
  while (rs.next()) {
      AttendanceBean ab = new AttendanceBean();
      ab.setUser_id(rs.getString("USER_ID"));
      ab.setUser_name(rs.getString("USER_NAME"));
      List tempArray = new ArrayList(); 
      for (int i=1;i&lt;=noOfDaysinMonth;i++) {
          tempArray.add(rs.getString("DAY_"+i));
      }
      ab.setDayArray(tempArray);
      alluser.add(ab);
  }  
  </code></pre>