/* * Copyright (C) 2020 Emeric Poupon * * This file is part of LMS. * * LMS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * LMS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LMS. If not, see . */ #include "database/Session.hpp" #include #include "core/ILogger.hpp" #include "core/ITraceLogger.hpp" #include "database/objects/Artist.hpp" #include "database/objects/ArtistInfo.hpp" #include "database/objects/Artwork.hpp" #include "database/objects/AuthToken.hpp" #include "database/objects/Cluster.hpp" #include "database/objects/Directory.hpp" #include "database/objects/Image.hpp" #include "database/objects/Listen.hpp" #include "database/objects/MediaLibrary.hpp" #include "database/objects/PlayListFile.hpp" #include "database/objects/PlayQueue.hpp" #include "database/objects/RatedArtist.hpp" #include "database/objects/RatedRelease.hpp" #include "database/objects/RatedTrack.hpp" #include "database/objects/Release.hpp" #include "database/objects/ScanSettings.hpp" #include "database/objects/StarredArtist.hpp" #include "database/objects/StarredRelease.hpp" #include "database/objects/StarredTrack.hpp" #include "database/objects/Track.hpp" #include "database/objects/TrackArtistLink.hpp" #include "database/objects/TrackBookmark.hpp" #include "database/objects/TrackEmbeddedImage.hpp" #include "database/objects/TrackEmbeddedImageLink.hpp" #include "database/objects/TrackFeatures.hpp" #include "database/objects/TrackList.hpp" #include "database/objects/TrackLyrics.hpp" #include "database/objects/UIState.hpp" #include "database/objects/User.hpp" #include "Db.hpp" #include "Migration.hpp" #include "TransactionChecker.hpp" #include "Utils.hpp" #include "traits/EnumSetTraits.hpp" #include "traits/ImageHashTypeTraits.hpp" #include "traits/PartialDateTimeTraits.hpp" #include "traits/PathTraits.hpp" namespace lms::db { Session::Session(IDb& db) : _db{ db } { _session.setConnectionPool(static_cast(_db).getConnectionPool()); _session.mapClass("artist"); _session.mapClass("artist_info"); _session.mapClass("artwork"); _session.mapClass("auth_token"); _session.mapClass("cluster"); _session.mapClass("cluster_type"); _session.mapClass("country"); _session.mapClass("directory"); _session.mapClass("image"); _session.mapClass