@Override
    protected Integer mapForeignKey(ResultSet rs) throws SQLException {
        if (rs.getObject("visits.pet_id") == null) {
            return null;
        } else {
            return rs.getInt("visits.pet_id");
        }
    }
{@link ResultSetExtractor} implementation by using the
{@link OneToManyResultSetExtractor} of Spring Data Core JDBC Extensions.
src/main/java/org/springframework/samples/petclinic/repository/jdbc/JdbcPetVisitExtractor.java