From 3053d869611dfe5c726d3b786ffa0b65e69c96c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 27 Jul 2012 13:15:47 +0200 Subject: [PATCH] Use new method to load artist properties. --- .../pterodactylus/demoscenemusic/data/DataManager.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java index 5324d28..77f5ade 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java @@ -241,22 +241,7 @@ public class DataManager { * if a database error occurs */ public Artist loadProperties(final Artist artist) throws DatabaseException { - Query query = new Query(Type.SELECT, "ARTIST_PROPERTIES"); - query.addField(new Field("ARTIST_PROPERTIES.PROPERTY")); - query.addField(new Field("ARTIST_PROPERTIES.VALUE")); - query.addWhereClause(new ValueFieldWhereClause(new ValueField("ARTIST", new StringParameter(artist.getId())))); - database.process(query, new ResultProcessor() { - - @Override - public void processResult(ResultSet resultSet) throws SQLException { - if (resultSet.isFirst()) { - artist.getProperties().removeAll(); - } - artist.getProperties().set(resultSet.getString("ARTIST_PROPERTIES.PROPERTY"), resultSet.getString("ARTIST_PROPERTIES.VALUE")); - } - - }); - return artist; + return loadProperties(artist, "ARTIST_PROPERTIES", "ARTIST"); } /** -- 2.7.4