enabled has_many processing for test models

This commit is contained in:
Sascha Kühl
2025-02-07 11:47:18 +01:00
parent 8ef78bb658
commit 005b42d131
2 changed files with 7 additions and 8 deletions
+4 -4
View File
@@ -16,14 +16,14 @@ struct ingredient
{
unsigned int id{};
std::string name;
std::vector<matador::object::object_ptr<recipe>> recipes;
std::vector<object::object_ptr<recipe>> recipes;
template<class Operator>
void process(Operator &op) {
namespace field = matador::access;
field::primary_key(op, "id", id);
field::attribute(op, "name", name, 255);
// field::has_many_to_many(op, "recipe_ingredients", recipes, "ingredient_id", "recipe_id", utils::fetch_type::EAGER);
field::has_many_to_many(op, "recipe_ingredients", recipes, "ingredient_id", "recipe_id", utils::fetch_type::EAGER);
}
};
@@ -31,14 +31,14 @@ struct recipe
{
unsigned int id{};
std::string name;
std::vector<matador::object::object_ptr<ingredient>> ingredients;
std::vector<object::object_ptr<ingredient>> ingredients;
template<class Operator>
void process(Operator &op) {
namespace field = matador::access;
field::primary_key(op, "id", id);
field::attribute(op, "name", name, 255);
// field::has_many_to_many(op, "recipe_ingredients", ingredients, utils::fetch_type::LAZY);
field::has_many_to_many(op, "recipe_ingredients", ingredients, utils::fetch_type::LAZY);
}
};