enabled has many relations and removed obsolete namespaces

This commit is contained in:
Sascha Kühl
2025-02-07 12:52:56 +01:00
parent 81cd8eecb2
commit 936ba06458
3 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -17,7 +17,7 @@ struct course;
struct student {
unsigned int id{};
std::string name;
std::vector<matador::object::object_ptr<course>> courses;
std::vector<object::object_ptr<course>> courses;
student() = default;
explicit student(unsigned int id, std::string name)
@@ -29,7 +29,7 @@ struct student {
namespace field = matador::access;
field::primary_key(op, "id", id);
field::attribute(op, "name", name, 255);
// field::has_many_to_many(op, "student_courses", courses, "student_id", "course_id", utils::fetch_type::LAZY);
field::has_many_to_many(op, "student_courses", courses, "student_id", "course_id", utils::fetch_type::LAZY);
}
};
@@ -37,7 +37,7 @@ struct student {
struct course {
unsigned int id{};
std::string title;
std::vector<matador::object::object_ptr<student>> students;
std::vector<object::object_ptr<student>> students;
course() = default;
explicit course(unsigned int id, std::string title)
@@ -49,7 +49,7 @@ struct course {
namespace field = matador::access;
field::primary_key(op, "id", id);
field::attribute(op, "title", title, 255);
// field::has_many_to_many(op, "student_courses", students, utils::fetch_type::EAGER);
field::has_many_to_many(op, "student_courses", students, utils::fetch_type::EAGER);
}
};