title: ParameterizedRowMapper That Maps Object List to Object
body: <p>I am trying to set the Parent List in a ParameterizedRowMapper how is this written or approached. I have two Objects one for parent and one for children however children contains a ListThe parents for each child are stored in a separate table in the database and the mapping is 1 - many. </p>
  
  <p>The select for the records for the parents will be done in a separate ResultSet. Will the mapping have to be done separately (<em>separate ParameterizedRowMapper</em>), if so how will i have to write the <strong>ParameterizedRowMapper</strong> this is the major concern how <strong>ParameterizedRowMapper</strong> is written to accommodate a list items.    </p>
  
  <p><strong>ParameterizedRowMapper</strong></p>
  
  <pre><code>public static class ChildrenMapper implements ParameterizedRowMapper&lt;Children&gt;{         
  
           public Children mapRow(ResultSet rs, int rowNum) throws SQLException {
                  Children child = new Children();
                  child.setFirstName(rs.getString("firstName"));
                  child.setLastName(rs.getString("lastName"));
                      //a child can have many Parents or gaurdians
                  child.setParent(List&lt;Parent&gt;);                  
  
                  return child;
              }       
      }
  </code></pre>
  
  <p>Based on my research i have found that i need to use <strong>ResultSetExtractor</strong>, however i have a questions on the use of that. Do i integrate it into the class at the point of setting the Parent? Can someone guide me on how it can be done the correct way</p>
  
  <p><strong>Children.java</strong></p>
  
  <pre><code>Public class Children(){
  int cid;
  String firstName;
  String lastName;
  List&lt;Parent&gt;parents;
  ..
  
  //getters/setters
  
  }
  </code></pre>
  
  <p><strong>Parent.java</strong></p>
  
  <pre><code>Public class Parent(){
   int pid;
  String firstName;
  String lastName;
  ..
  
  //setters/getters
  }
  </code></pre>