Implemented deletion functionality, and lingering records are removed fixes #49
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef ARTISTREPOSITORY_H_
|
||||
#define ARTISTREPOSITORY_H_
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "database/BaseRepository.h"
|
||||
@@ -16,14 +17,19 @@ namespace database
|
||||
|
||||
std::vector<model::Artist> retrieveRecords();
|
||||
|
||||
std::pair<model::Artist, int> retrieveRecordWithSongCount(model::Artist&, type::ArtistFilter);
|
||||
|
||||
model::Artist retrieveRecord(model::Artist&, type::ArtistFilter);
|
||||
|
||||
bool doesArtistExist(const model::Artist&, type::ArtistFilter);
|
||||
|
||||
void saveRecord(const model::Artist&);
|
||||
void deleteArtist(const model::Artist&, type::ArtistFilter);
|
||||
private:
|
||||
std::vector<model::Artist> parseRecords(MYSQL_STMT*);
|
||||
|
||||
std::pair<model::Artist, int> parseRecordWithSongCount(MYSQL_STMT*);
|
||||
|
||||
// TODO: After parseRecord(MYSQL_STMT*) is implemented
|
||||
// remove parseRecord(MYSQL_RES*)
|
||||
model::Artist parseRecord(MYSQL_RES*);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef GENREREPOSITORY_H_
|
||||
#define GENREREPOSITORY_H_
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "database/BaseRepository.h"
|
||||
@@ -16,14 +17,19 @@ namespace database
|
||||
|
||||
std::vector<model::Genre> retrieveRecords();
|
||||
|
||||
std::pair<model::Genre, int> retrieveRecordWithSongCount(model::Genre&, type::GenreFilter);
|
||||
|
||||
model::Genre retrieveRecord(model::Genre&, type::GenreFilter);
|
||||
|
||||
bool doesGenreExist(const model::Genre&, type::GenreFilter);
|
||||
|
||||
void saveRecord(const model::Genre&);
|
||||
void deleteRecord(const model::Genre&, type::GenreFilter);
|
||||
private:
|
||||
std::vector<model::Genre> parseRecords(MYSQL_STMT*);
|
||||
|
||||
std::pair<model::Genre, int> parseRecordWithSongCount(MYSQL_STMT*);
|
||||
|
||||
// TODO: After parseRecord(MYSQL_STMT*) is implemented
|
||||
// remove parseRecord(MYSQL_RES*)
|
||||
model::Genre parseRecord(MYSQL_RES*);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace database
|
||||
|
||||
model::Song retrieveRecord(model::Song&, type::SongFilter);
|
||||
|
||||
void deleteRecord(const model::Song&);
|
||||
bool deleteRecord(const model::Song&);
|
||||
void saveRecord(const model::Song&);
|
||||
private:
|
||||
std::vector<model::Song> parseRecords(MYSQL_RES*); // TODO: to be removed
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef YEARREPOSITORY_H_
|
||||
#define YEARREPOSITORY_H_
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "database/BaseRepository.h"
|
||||
@@ -16,14 +17,19 @@ namespace database
|
||||
|
||||
std::vector<model::Year> retrieveRecords();
|
||||
|
||||
std::pair<model::Year, int> retrieveRecordWithSongCount(model::Year&, type::YearFilter);
|
||||
|
||||
model::Year retrieveRecord(model::Year&, type::YearFilter);
|
||||
|
||||
bool doesYearExist(const model::Year&, type::YearFilter);
|
||||
|
||||
void saveRecord(const model::Year&);
|
||||
void deleteYear(const model::Year&, type::YearFilter);
|
||||
private:
|
||||
std::vector<model::Year> parseRecords(MYSQL_STMT*);
|
||||
|
||||
std::pair<model::Year, int> parseRecordWithSongCount(MYSQL_STMT*);
|
||||
|
||||
// TODO: After parseRecord(MYSQL_STMT*) is implemented
|
||||
// remove parseRecord(MYSQL_RES*)
|
||||
model::Year parseRecord(MYSQL_RES*);
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace manager
|
||||
model::Artist retrieveArtist(model::Artist&);
|
||||
model::Artist saveArtist(const model::Song&);
|
||||
|
||||
void deleteArtist(const model::Song&);
|
||||
|
||||
static void printArtist(const model::Artist&);
|
||||
private:
|
||||
model::BinaryPath m_bConf;
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace manager
|
||||
model::Genre retrieveGenre(model::Genre&);
|
||||
model::Genre saveGenre(const model::Song&);
|
||||
|
||||
void deleteGenre(const model::Song&);
|
||||
|
||||
static void printGenre(const model::Genre&);
|
||||
private:
|
||||
model::BinaryPath m_bConf;
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace manager
|
||||
model::Year retrieveYear(model::Year&);
|
||||
model::Year saveYear(const model::Song&);
|
||||
|
||||
void deleteYear(const model::Song&);
|
||||
|
||||
static void printYear(const model::Year&);
|
||||
private:
|
||||
model::BinaryPath m_bConf;
|
||||
|
||||
Reference in New Issue
Block a user