handle many-to-many relations separately when process entities

This commit is contained in:
2024-04-07 14:45:57 +02:00
parent 30e2e0c221
commit fa7ff832c9
19 changed files with 484 additions and 96 deletions
+5 -1
View File
@@ -3,10 +3,14 @@
#include "matador/utils/access.hpp"
#include "matador/sql/entity.hpp"
#include <string>
namespace matador::test {
struct book;
struct author
{
unsigned long id{};
@@ -27,7 +31,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);
field::has_many(op, books, "author_id", utils::fetch_type::LAZY);
}
};