public List<ColorModel> getAllColor() {
String query = "SELECT * FROM COLOR";
List<ColorModel> colors = getjdbcTemplate().query(query, new ColorMapper());
return colors;
}
class ColorMapper implements RowMapper<Color> {
public ColorModel mapRow(ResultSet rs, int rowNum) throws SQLException {
ColorModel color = new ColorModel ();
color.setId(rs.getInt("ID"));
color.setName(rs.getString("color_name"));
}
}
質問
LinkedHashMap<Integer, String>
ではなくa を返すにはどうすればよいですかList<ColorModel>