From 936ba06458a0f7e2c2be579d3f1917f44577a89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20K=C3=BChl?= Date: Fri, 7 Feb 2025 12:52:56 +0100 Subject: [PATCH] enabled has many relations and removed obsolete namespaces --- test/models/flight.hpp | 4 ++-- test/models/product.hpp | 4 ++-- test/models/student.hpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/models/flight.hpp b/test/models/flight.hpp index db40047..b01da0c 100644 --- a/test/models/flight.hpp +++ b/test/models/flight.hpp @@ -21,7 +21,7 @@ struct flight : id(id), airplane(plane), pilot_name(std::move(name)) {} unsigned int id{}; - object::object_ptr airplane; + object::object_ptr airplane; std::string pilot_name; template @@ -29,7 +29,7 @@ struct flight namespace field = matador::access; using namespace matador::utils; field::primary_key(op, "id", id); - // field::has_one(op, "airplane_id", airplane, {utils::cascade_type::ALL, utils::fetch_type::EAGER}); + field::has_one(op, "airplane_id", airplane, {utils::cascade_type::ALL, utils::fetch_type::EAGER}); field::attribute(op, "pilot_name", pilot_name, 255); } }; diff --git a/test/models/product.hpp b/test/models/product.hpp index c2dd794..6dfd72d 100644 --- a/test/models/product.hpp +++ b/test/models/product.hpp @@ -16,8 +16,8 @@ namespace matador::test { struct product { std::string product_name; - object::object_ptr supplier; - object::object_ptr category; + object::object_ptr supplier; + object::object_ptr category; std::string quantity_per_unit; unsigned int unit_price; unsigned int units_in_stock; diff --git a/test/models/student.hpp b/test/models/student.hpp index 02dd0fa..cbfeba2 100644 --- a/test/models/student.hpp +++ b/test/models/student.hpp @@ -17,7 +17,7 @@ struct course; struct student { unsigned int id{}; std::string name; - std::vector> courses; + std::vector> 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> students; + std::vector> 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); } };