From: David ‘Bombe’ Roden Date: Tue, 31 Jul 2012 05:01:31 +0000 (+0200) Subject: Use new and improved method to load properties. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8ee27528d19f7e96f330daec1060ca137bedac20;p=demoscenemusic.git Use new and improved method to load properties. --- diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java index 5972bd8..a11027c 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java @@ -276,10 +276,7 @@ public class DataManager { * if a database error occurs */ public List loadArtistProperties(List artists) throws DatabaseException { - for (Artist artist : artists) { - loadArtistProperties(artist); - } - return artists; + return loadProperties(artists, "ARTIST_PROPERTIES", "ARTIST"); } /** @@ -424,10 +421,7 @@ public class DataManager { * if a database error occurs */ public List loadTrackProperties(List tracks) throws DatabaseException { - for (Track track : tracks) { - loadTrackProperties(track); - } - return tracks; + return loadProperties(tracks, "TRACK_PROPERTIES", "TRACK"); } /** @@ -564,10 +558,7 @@ public class DataManager { * if a database error occurs */ public List loadTrackDerivativeProperties(List trackDerivatives) throws DatabaseException { - for (TrackDerivative trackDerivative : trackDerivatives) { - loadTrackDerivativeProperties(trackDerivative); - } - return trackDerivatives; + return loadProperties(trackDerivatives, "TRACK_DERIVATIVE_PROPERTIES", "TRACK_DERIVATIVE"); } /** @@ -669,11 +660,8 @@ public class DataManager { * @throws DatabaseException * if a database error occurs */ - public Collection loadGroupProperties(Collection groups) throws DatabaseException { - for (Group group : groups) { - loadGroupProperties(group); - } - return groups; + public Collection loadGroupProperties(List groups) throws DatabaseException { + return loadProperties(groups, "GROUP_PROPERTIES", "GROUP_ID"); } /** @@ -809,10 +797,7 @@ public class DataManager { * if a database error occurs */ public List loadPartyProperties(List parties) throws DatabaseException { - for (Party party : parties) { - loadPartyProperties(party); - } - return parties; + return loadProperties(parties, "PARTY_PROPERTIES", "PARTY"); } /**