From b17c4244ed63e1d753000907f0d31cea8b53611e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 19 Apr 2012 16:32:22 +0200 Subject: [PATCH] Use artist creator to get artist by ID. --- .../java/net/pterodactylus/demoscenemusic/data/DataManager.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java index d8b9d62..e595121 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java @@ -66,15 +66,8 @@ public class DataManager { public Artist getArtistById(String id) 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.addWhereClause(new ValueFieldWhereClause(new ValueField("ARTISTS.ID", new StringParameter(id)))); - query.addOrderField(new OrderField(new Field("ARTISTS.ID"))); - ArtistLoader artistLoader = new ArtistLoader(); - database.process(query, artistLoader); - return artistLoader.get(); + return database.getSingle(query, artistCreator); } public Collection getArtistsByGroup(String groupId) throws DatabaseException { -- 2.7.4