implemented lazy loading for object_ptr and belongs_to
This commit is contained in:
@@ -11,6 +11,9 @@ namespace matador::test {
|
||||
struct employee;
|
||||
|
||||
struct department {
|
||||
department() = default;
|
||||
department(const unsigned int id, std::string name)
|
||||
: id(id), name(std::move(name)) {}
|
||||
unsigned int id{};
|
||||
std::string name;
|
||||
std::vector<object::object_ptr<employee>> employees{};
|
||||
@@ -27,6 +30,9 @@ struct department {
|
||||
};
|
||||
|
||||
struct employee {
|
||||
employee() = default;
|
||||
employee(const unsigned int id, std::string first, std::string last, object::object_ptr<department> dep)
|
||||
: id(id), first_name(std::move(first)), last_name(std::move(last)), dep(std::move(dep)) {}
|
||||
unsigned int id{};
|
||||
std::string first_name;
|
||||
std::string last_name;
|
||||
|
||||
Reference in New Issue
Block a user