#ifndef ALBUMREPOSITORY_H_ #define ALBUMREPOSITORY_H_ #include #include #include #include "database/BaseRepository.h" #include "model/Models.h" #include "type/AlbumFilter.h" namespace database { class AlbumRepository : public BaseRepository { public: AlbumRepository(const model::BinaryPath&); std::vector retrieveRecords(); std::pair retrieveRecordWithSongCount(model::Album&, type::AlbumFilter); model::Album retrieveRecord(model::Album&, type::AlbumFilter); bool doesAlbumExists(const model::Album&, type::AlbumFilter); void saveAlbum(const model::Album&); void deleteAlbum(const model::Album&, type::AlbumFilter); private: std::vector parseRecords(MYSQL_STMT*); std::pair parseRecordWithSongCount(MYSQL_STMT*); std::shared_ptr valueBind(model::Album&, std::tuple&); std::shared_ptr valueBindWithSongCount(model::Album&, std::tuple&, int&); std::tuple metadataBuffer(); model::Album parseRecord(MYSQL_STMT*); }; } #endif