Java Reference
In-Depth Information
Figure 7-6. Customer data model
To implement a JDBC reader (either cursor-based or page-based), you will need to do two things:
configure the reader to execute the query that is required and create a RowMapper implementation just
like the Spring JdbcTemplate requires to map your ResultSet to your domain object. Since the
RowMapper implementation will be the same for each approach, you can start there.
A RowMapper is exactly what it sounds like. It takes a row from a ResultSet and maps the fields to a
domain object. In your case, you will be mapping the fields of the Customer table to the Customer
domain object. Listing 7-37 shows the CustomerRowMapper you'll use for your JDBC implementations.
Search WWH ::




Custom Search