title: Spring JDBC ResultSet Extractor get object inside object
body: <p>So for example we have a Person object:</p>
  
  <pre><code>private int id;
  private String firstName;
  private String lastName;
  private String sex;
  private int age;
  private Address address;
  </code></pre>
  
  <p>//Plus setters and getters</p>
  
  <p>Here is my resultset</p>
  
  <pre><code>public class PersonResultSet implements ResultSetExtractor&lt;Person&gt;{
  
  @Override
  public Person extractData(ResultSet rs) throws SQLException, DataAccessException {
      Person person = new Person();
      person.setId(rs.getInt("id"));
      person.setFirstName(rs.getString("firstName"));
      person.setLastName(rs.getString("lastName"));
      person.setSex(rs.getString("sex"));
      person.setAge(rs.getInt("age"));
      // How do i get the address from the table with the ID
  
      return person;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>How would I obtain the address from the address table corresponding to the address ID in the person table to that person?</p>