From 2128592e8c56c539c68b053721e9816cd3633800 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 26 Jul 2012 07:25:56 +0200 Subject: [PATCH] Add method to save an artist. --- .../pterodactylus/demoscenemusic/data/DataManager.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java index a6f5a54..42952f9 100644 --- a/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java +++ b/src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java @@ -168,6 +168,21 @@ public class DataManager { } /** + * Saves the given artist. + * + * @param artist + * The artist to save + * @throws DatabaseException + * if a database error occurs + */ + public void saveArtist(Artist artist) throws DatabaseException { + Query query = new Query(Type.UPDATE, "ARTISTS"); + query.addValueField(new ValueField("NAME", new StringParameter(artist.getName()))); + query.addWhereClause(new ValueFieldWhereClause(new ValueField("ID", new StringParameter(artist.getId())))); + database.update(query); + } + + /** * Returns all remix artists involved in the track with the given ID. * * @param trackId -- 2.7.4