i' ve a code snippet like below. but it gives error at list.add(mapper.mapRow()); line says "The method add(K) in the type List is not applicable for the arguments (Object)". how can i fix it?
thanks.
public List<K> fetchData(JStarRowMapper mapper) {
List<K> list = new ArrayList<K>();
list.add(mapper.mapRow());
return list;
}
public class IncomingRowMapper<K> implements JStarRowMapper {
@Override
public IncomingVO mapRow(ResultSet rs) throws SQLException {
IncomingVO vo = new IncomingVO();
vo.setId(rs.getInt("id"));
vo.setUsername(rs.getString("username"));
vo.setProcessDate(rs.getTimestamp("process_date"));
vo.setProcessCount(rs.getInt("process_count"));
return vo;
}
}
public interface JStarRowMapper<K> {
abstract public K mapRow(ResultSet rs) throws SQLException;
}