import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
import java.util.concurrent.Callable;
import net.pterodactylus.demoscenemusic.data.Track.Relationship;
}
/**
+ * Creates a new artist with the given name.
+ *
+ * @param name
+ * The name of the artist
+ * @return The created artist
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Artist createArtist(String name) throws DatabaseException {
+ Query query = new Query(Type.INSERT, "ARTISTS");
+ String id = UUID.randomUUID().toString();
+ query.addValueField(new ValueField("ID", new StringParameter(id)));
+ query.addValueField(new ValueField("NAME", new StringParameter(name)));
+ database.insert(query);
+ return getArtistById(id);
+ }
+
+ /**
* Returns all remix artists involved in the track with the given ID.
*
* @param trackId