From: David ‘Bombe’ Roden Date: Fri, 27 Jul 2012 11:15:47 +0000 (+0200) Subject: Use new method to load artist properties. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3053d869611dfe5c726d3b786ffa0b65e69c96c3;p=demoscenemusic.git Use new method to load artist properties. --- 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"); } /**