"select ai.smallimageurl, ai.mediumimageurl, ai.largeimageurl, ai.extralargeimageurl, " +
"ai.listeners, ai.playcount, ai.biosummary, ai.biocontent from music.artistinfo ai" +
" inner join music.artist a on ai.artist_id = a.id" +
" where a.artist_name = upper(?)";
ArtistInfo artistInfo = jdbcTemplate.queryForObject(sql, new Object[]{artist.getName()},
new RowMapper<ArtistInfo>() {
@Override
public ArtistInfo mapRow(ResultSet rs, int rowNum)
throws SQLException {
ArtistInfo ai = new ArtistInfo();
ai.setArtist(artist);
ai.setSmallImageUrl(rs.getString(1));
ai.setMediumImageUrl(rs.getString(2));
ai.setLargeImageUrl(rs.getString(3));
ai.setExtraLargeImageUrl(rs.getString(4));
ai.setListeners(rs.getInt(5));
ai.setPlayCount(rs.getInt(6));
ai.setBioSummary(rs.getString(7));
ai.setBioContent(rs.getString(8));
return ai;
}
});