object generation progress
This commit is contained in:
@@ -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() );
|
||||
}
|
||||
Reference in New Issue
Block a user