added to many fields to entities author, book, recipe and ingredient

This commit is contained in:
2024-03-29 11:41:14 +01:00
parent 05c0c0393d
commit 6f3e589e10
3 changed files with 8 additions and 1 deletions
+2
View File
@@ -15,6 +15,7 @@ struct author
std::string date_of_birth;
unsigned short year_of_birth{};
bool distinguished{false};
std::vector<matador::sql::entity<book>> books;
template<typename Operator>
void process(Operator &op)
@@ -26,6 +27,7 @@ struct author
field::attribute(op, "date_of_birth", date_of_birth, 31);
field::attribute(op, "year_of_birth", year_of_birth);
field::attribute(op, "distinguished", distinguished);
field::has_many(op, "books", books, "author_id", "id", utils::fetch_type::LAZY);
}
};