1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.springframework.batch.sample.domain.football.internal;
17
18 import java.sql.ResultSet;
19 import java.sql.SQLException;
20
21 import org.springframework.batch.sample.domain.football.PlayerSummary;
22 import org.springframework.jdbc.core.RowMapper;
23
24
25
26
27
28
29
30 public class PlayerSummaryRowMapper implements RowMapper {
31
32
33
34
35 public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
36
37 PlayerSummary summary = new PlayerSummary();
38
39 summary.setId(rs.getString(1));
40 summary.setYear(rs.getInt(2));
41 summary.setCompletes(rs.getInt(3));
42 summary.setAttempts(rs.getInt(4));
43 summary.setPassingYards(rs.getInt(5));
44 summary.setPassingTd(rs.getInt(6));
45 summary.setInterceptions(rs.getInt(7));
46 summary.setRushes(rs.getInt(8));
47 summary.setRushYards(rs.getInt(9));
48 summary.setReceptions(rs.getInt(10));
49 summary.setReceptionYards(rs.getInt(11));
50 summary.setTotalTd(rs.getInt(12));
51
52 return summary;
53 }
54
55 }