Just create normal instances.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 12:44:50 +0000 (14:44 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 12:44:50 +0000 (14:44 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java

index ba2f61e..214d0c4 100644 (file)
@@ -94,31 +94,14 @@ public class DataManager {
                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);
                }
 
@@ -147,21 +130,11 @@ public class DataManager {
                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);
                }