From: David ‘Bombe’ Roden Date: Thu, 19 Apr 2012 14:29:12 +0000 (+0200) Subject: Use artist creator for retrieving artists. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b5e803e4827b31393806bcf042e2413a6c340044;p=demoscenemusic.git Use artist creator for retrieving artists. --- diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java index a3af13c..5554f76 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java @@ -59,14 +59,7 @@ public class DataManager { public Collection getAllArtists() throws DatabaseException { Query query = new Query(Type.SELECT, "ARTISTS"); query.addField(new Field("ARTISTS.*")); - query.addField(new Field("GROUP_ARTISTS.*")); - query.addField(new Field("GROUPS.*")); - query.addJoin(new Join(JoinType.INNER, "GROUP_ARTISTS", new Field("ARTISTS.ID"), new Field("GROUP_ARTISTS.ARTIST"))); - query.addJoin(new Join(JoinType.INNER, "GROUPS", new Field("GROUP_ARTISTS.GROUP_"), new Field("GROUPS.ID"))); - query.addOrderField(new OrderField(new Field("ARTISTS.ID"))); - ArtistLoader artistLoader = new ArtistLoader(); - database.process(query, artistLoader); - return artistLoader.all(); + return database.getMultiple(query, artistCreator); } public Artist getArtistById(String id) throws DatabaseException {