public void processResult(ResultSet resultSet) throws SQLException {
String trackId = resultSet.getString("TRACKS.ID");
if ((track == null) || (!track.id().equals(trackId))) {
- track = new AbstractTrack(trackId) {
-
- public void save() {
- if (!dirty()) {
- return;
- }
- }
- }.name(resultSet.getString("TRACKS.NAME")).artists(new ArrayList<Artist>()).styles(new HashSet<Style>());
+ track = new DefaultTrack(trackId).name(resultSet.getString("TRACKS.NAME")).artists(new ArrayList<Artist>()).styles(new HashSet<Style>());
loadedTracks.add(track);
}
- Artist artist = new AbstractArtist(resultSet.getString("ARTISTS.ID")) {
-
- public void save() {
- }
-
- }.name(resultSet.getString("ARTISTS.NAME"));
+ Artist artist = new DefaultArtist(resultSet.getString("ARTISTS.ID")).name(resultSet.getString("ARTISTS.NAME"));
if (!track.artists().contains(artist)) {
track.artists().add(artist);
}
- Style style = new AbstractStyle(resultSet.getString("STYLES.ID")) {
-
- public void save() {
- }
-
- }.name(resultSet.getString("STYLES.NAME"));
+ Style style = new DefaultStyle(resultSet.getString("STYLES.ID")).name(resultSet.getString("STYLES.NAME"));
track.styles().add(style);
}
public void processResult(ResultSet resultSet) throws SQLException {
String artistId = resultSet.getString("ARTISTS.ID");
if ((artist == null) || (!artist.id().equals(artistId))) {
- artist = new AbstractArtist(artistId) {
-
- public void save() {
- }
-
- }.name(resultSet.getString("ARTISTS.NAME")).groups(new HashSet<Group>());
+ artist = new DefaultArtist(artistId).name(resultSet.getString("ARTISTS.NAME")).groups(new HashSet<Group>());
artists.add(artist);
}
- Group group = new AbstractGroup(resultSet.getString("GROUPS.ID")) {
-
- public void save() {
- }
-
- }.name(resultSet.getString("GROUPS.NAME")).url(resultSet.getString("GROUPS.URL"));
+ Group group = new DefaultGroup(resultSet.getString("GROUPS.ID")).name(resultSet.getString("GROUPS.NAME")).url(resultSet.getString("GROUPS.URL"));
artist.groups().add(group);
}