introduced field_attributes shortcuts and added method on_base() to all processor classes
This commit is contained in:
@@ -24,7 +24,7 @@ struct department {
|
||||
void process(Operator &op) {
|
||||
namespace field = matador::access;
|
||||
field::primary_key(op, "id", id);
|
||||
field::attribute(op, "name", name, 63);
|
||||
field::attribute(op, "name", name, UniqueVarChar63);
|
||||
field::has_many(op, "employees", employees, "dep_id", utils::CascadeAllFetchEager);
|
||||
// field::belongs_to(op, "manager_id", manager, utils::fetch_type::EAGER);
|
||||
}
|
||||
@@ -43,8 +43,8 @@ struct employee {
|
||||
void process(Operator &op) {
|
||||
namespace field = matador::access;
|
||||
field::primary_key(op, "id", id);
|
||||
field::attribute(op, "first_name", first_name, 63);
|
||||
field::attribute(op, "last_name", last_name, 63);
|
||||
field::attribute(op, "first_name", first_name, VarChar63);
|
||||
field::attribute(op, "last_name", last_name, VarChar63);
|
||||
field::belongs_to(op, "dep_id", dep, utils::CascadeAllFetchLazy);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user