Add object creator for track derivatives.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 27 Jul 2012 11:14:51 +0000 (13:14 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 27 Jul 2012 11:14:51 +0000 (13:14 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java

index 373f80c..7943401 100644 (file)
@@ -64,6 +64,10 @@ public class DataManager {
        @SuppressWarnings("synthetic-access")
        private final ObjectCreator<Track> trackCreator = new TrackCreator();
 
+       /** The track object creator. */
+       @SuppressWarnings("synthetic-access")
+       private final ObjectCreator<TrackDerivative> trackDerivativeCreator = new TrackDerivativeCreator();
+
        /** The style object creator. */
        @SuppressWarnings("synthetic-access")
        private final ObjectCreator<Style> styleCreator = new StyleCreator();
@@ -722,6 +726,24 @@ public class DataManager {
        }
 
        /**
+        * {@link ObjectCreator} implementation that can create
+        * {@link TrackDerivative} objects.
+        *
+        * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+        */
+       private class TrackDerivativeCreator implements ObjectCreator<TrackDerivative> {
+
+               /**
+                * {@inheritDoc}
+                */
+               @Override
+               public TrackDerivative createObject(ResultSet resultSet) throws SQLException {
+                       return new DefaultTrackDerivative(resultSet.getString("TRACK_DERIVATIVES.ID"));
+               }
+
+       }
+
+       /**
         * {@link ObjectCreator} implementation that can create {@link Style}
         * objects.
         *