Add method to save an artist.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 26 Jul 2012 05:25:56 +0000 (07:25 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 26 Jul 2012 05:28:49 +0000 (07:28 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java

index a6f5a54..42952f9 100644 (file)
@@ -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