has many fetch with join
This commit is contained in:
@@ -38,7 +38,7 @@ struct employee {
|
||||
field::primary_key(op, "id", id);
|
||||
field::attribute(op, "first_name", first_name, 63);
|
||||
field::attribute(op, "last_name", last_name, 63);
|
||||
field::belongs_to(op, "dep_id", dep, utils::fetch_type::EAGER);
|
||||
field::belongs_to(op, "dep_id", dep, utils::fetch_type::LAZY);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ struct flight {
|
||||
namespace field = matador::access;
|
||||
using namespace matador::utils;
|
||||
field::primary_key(op, "id", id);
|
||||
field::has_one(op, "airplane_id", plane, {utils::cascade_type::ALL, utils::fetch_type::EAGER});
|
||||
field::has_one(op, "airplane_id", plane, {utils::cascade_type::ALL, fetch_type::EAGER});
|
||||
field::attribute(op, "pilot_name", pilot_name, 255);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user