Search in sources :

Example 1 with TrackWithArtistRowMapper

use of com.github.hakko.musiccabinet.dao.jdbc.rowmapper.TrackWithArtistRowMapper in project musiccabinet by hakko.

the class JdbcArtistTopTracksDao method getTopTracks.

@Override
public List<Track> getTopTracks(Artist artist) {
    final int artistId = jdbcTemplate.queryForInt("select * from music.get_artist_id(?)", artist.getName());
    String sql = "select artist_name_capitalization, track_name_capitalization" + " from music.artisttoptrack att" + " inner join music.artist a on att.artist_id = a.id" + " inner join music.track t on att.track_id = t.id" + " where a.id = ? order by att.rank";
    return jdbcTemplate.query(sql, new Object[] { artistId }, new TrackWithArtistRowMapper());
}
Also used : TrackWithArtistRowMapper(com.github.hakko.musiccabinet.dao.jdbc.rowmapper.TrackWithArtistRowMapper)

Aggregations

TrackWithArtistRowMapper (com.github.hakko.musiccabinet.dao.jdbc.rowmapper.TrackWithArtistRowMapper)1