}
/**
+ * Creates a new derivative for the given track.
+ *
+ * @param track
+ * The track to create the derivative for
+ * @return The created derivative
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public TrackDerivative createTrackDerivative(Track track) throws DatabaseException {
+ Query query = new Query(Type.INSERT, "TRACK_DERIVATIVES");
+ String id = UUID.randomUUID().toString();
+ query.addValueField(new ValueField("TRACK_DERIVATIVES.ID", new StringParameter(id)));
+ query.addValueField(new ValueField("TRACK_DERIVATIVES.TRACK", new StringParameter(track.getId())));
+ database.insert(query);
+ return getTrackDerivativeById(id);
+ }
+
+ /**
* Loads the properties for the given track derivative.
*
* @param trackDerivative