introduced field_attributes shortcuts and added method on_base() to all processor classes
This commit is contained in:
@@ -29,7 +29,7 @@ struct ingredient {
|
||||
void process(Operator &op) {
|
||||
namespace field = matador::access;
|
||||
field::primary_key(op, "id", id);
|
||||
field::attribute(op, "name", name, 255);
|
||||
field::attribute(op, "name", name, UniqueVarChar255);
|
||||
field::has_many_to_many(op, "recipe_ingredients", recipes, "ingredient_id", "recipe_id", utils::CascadeAllFetchEager);
|
||||
}
|
||||
};
|
||||
@@ -53,15 +53,10 @@ struct recipe {
|
||||
void process(Operator &op) {
|
||||
namespace field = matador::access;
|
||||
field::primary_key(op, "id", id);
|
||||
field::attribute(op, "name", name, 255);
|
||||
field::attribute(op, "name", name, UniqueVarChar255);
|
||||
field::has_many_to_many(op, "recipe_ingredients", ingredients, utils::CascadeAllFetchLazy);
|
||||
}
|
||||
};
|
||||
|
||||
// class recipe_ingredient : public object::many_to_many_relation<recipe, ingredient> {
|
||||
// public:
|
||||
// recipe_ingredient() : many_to_many_relation("recipe_id", "ingredient_id") {}
|
||||
// };
|
||||
}
|
||||
|
||||
#endif //QUERY_RECIPE_HPP
|
||||
|
||||
Reference in New Issue
Block a user