+ return loadTrackProperties(database.getMultiple(query, trackCreator));
+ }
+
+ /**
+ * Loads the properties for the given track.
+ *
+ * @param track
+ * The track for which to load the properties
+ * @return The track with the properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Track loadTrackProperties(Track track) throws DatabaseException {
+ return loadProperties(track, "TRACK_PROPERTIES", "TRACK");
+ }
+
+ /**
+ * Loads the properties for the given tracks.
+ *
+ * @param tracks
+ * The tracks for which to load the properties
+ * @return The tracks with the properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public List<Track> loadTrackProperties(List<Track> tracks) throws DatabaseException {
+ for (Track track : tracks) {
+ loadTrackProperties(track);
+ }
+ return tracks;
+ }
+
+ /**
+ * Creates a new track with the given name.
+ *
+ * @param name
+ * The name of the track
+ * @return The created track
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Track createTrack(String name) throws DatabaseException {
+ Query query = new Query(Type.INSERT, "TRACKS");
+ 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 getTrackById(id);