object generation progress

This commit is contained in:
2025-12-01 22:03:07 +01:00
parent 422df82b7c
commit c156ab5e74
10 changed files with 62 additions and 77 deletions
+11 -9
View File
@@ -18,13 +18,15 @@ struct student final : person {};
struct teacher final : person {};
struct names {
std::vector<std::string> names_list;
unsigned int id{};
std::vector<std::string> names_list;
template<typename Operator>
void process(Operator &op) {
namespace field = matador::access;
field::has_many(op, "name_list", names_list, "names_id", utils::fetch_type::EAGER);
}
template<typename Operator>
void process(Operator &op) {
namespace field = matador::access;
field::primary_key(op, "id", id);
field::has_many(op, "name_list", names_list, "names_id", utils::fetch_type::EAGER);
}
};
TEST_CASE("Test empty prototype tree", "[schema_node][empty]") {
@@ -75,10 +77,10 @@ TEST_CASE("Test automatic creating of a relation table with foreign key", "[sche
}
TEST_CASE("Test automatic creating of a relation table with values", "[schema][relation_table][values]") {
object::repository tree;
object::repository repo;
REQUIRE( tree.empty() );
REQUIRE( repo.empty() );
auto res = tree.attach<names>("names");
auto res = repo.attach<names>("names");
REQUIRE( res.is_ok() );
}