Refactored the inputvector part of the som implementation
This commit is contained in:
@@ -119,11 +119,15 @@ Track::getAllWithMBIDAndMissingFeatures(Wt::Dbo::Session& session)
|
||||
}
|
||||
|
||||
std::vector<Track::pointer>
|
||||
Track::getAllWithFeatures(Wt::Dbo::Session& session)
|
||||
Track::getAllWithFeatures(Wt::Dbo::Session& session, boost::optional<std::size_t> limit)
|
||||
{
|
||||
int size {limit ? static_cast<int>(*limit) : -1};
|
||||
|
||||
Wt::Dbo::collection<pointer> res = session.query<pointer>
|
||||
("SELECT t FROM track t")
|
||||
.where("EXISTS (SELECT * from track_features t_f WHERE t_f.track_id = t.id)");
|
||||
.where("EXISTS (SELECT * from track_features t_f WHERE t_f.track_id = t.id)")
|
||||
.limit(size);
|
||||
|
||||
return std::vector<pointer>(res.begin(), res.end());
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class Track : public Wt::Dbo::Dbo<Track>
|
||||
static std::vector<pointer> getChecksumDuplicates(Wt::Dbo::Session& session);
|
||||
static std::vector<pointer> getLastAdded(Wt::Dbo::Session& session, Wt::WDateTime after, int size = 1);
|
||||
static std::vector<pointer> getAllWithMBIDAndMissingFeatures(Wt::Dbo::Session& session); // nested transaction
|
||||
static std::vector<pointer> getAllWithFeatures(Wt::Dbo::Session& session); // nested transaction
|
||||
static std::vector<pointer> getAllWithFeatures(Wt::Dbo::Session& session, boost::optional<std::size_t> limit = {}); // nested transaction
|
||||
|
||||
// Create utility
|
||||
static pointer create(Wt::Dbo::Session& session, const boost::filesystem::path& p);
|
||||
|
||||
Reference in New Issue
Block a user