return getJdbcOperations().query(query.getSql(),
query.getParameters(), new RowMapper<Review>(){
@Override
public Review mapRow(ResultSet rs, int rowNum)
throws SQLException {
Review review = new Review();
review.setId(rs.getInt("review_id"));
review.setProductName(rs.getString("name"));
review.setAuthor(rs.getString("author"));
review.setRating(rs.getInt("rating"));
review.setStatus(rs.getShort("status"));
review.setDateAdded(rs.getDate("date_added"));
return review;
}
});
}