From: David ‘Bombe’ Roden Date: Thu, 26 Jul 2012 05:25:56 +0000 (+0200) Subject: Add method to save an artist. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2128592e8c56c539c68b053721e9816cd3633800;p=demoscenemusic.git Add method to save an artist. --- 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