Compare commits

..

No commits in common. "6cb501ded9a124bf294a6d97dfb27587d0ebce57" and "936ba06458a0f7e2c2be579d3f1917f44577a89b" have entirely different histories.

2 changed files with 3 additions and 5 deletions

View File

@ -25,7 +25,7 @@ struct order
std::string ship_region;
std::string ship_postal_code;
std::string ship_country;
std::vector<object::object_ptr<order_details>> order_details_;
std::vector<matador::object::object_ptr<order_details>> order_details_;
template<class Operator>
void process(Operator &op) {
@ -42,7 +42,7 @@ struct order
field::attribute(op, "ship_region", ship_region, 255);
field::attribute(op, "ship_postal_code", ship_postal_code, 255);
field::attribute(op, "ship_country", ship_country, 255);
field::has_many(op, "order_details", order_details_, "order_id", utils::fetch_type::EAGER);
// field::has_many(op, order_details_, "order_id", utils::fetch_type::EAGER);
}
};

View File

@ -42,10 +42,8 @@ TEST_CASE("Generate columns from object", "[column][generator]") {
TEST_CASE("Generate columns for object with has many relation", "[column][generator][relation]") {
using namespace matador::test;
schema s("main");
auto result = s.attach<supplier>("supplier")
.and_then( [&s] { return s.attach<category>("categories"); } )
auto result = s.attach<product>("product")
.and_then( [&s] { return s.attach<order_details>("order_details"); } )
.and_then( [&s] { return s.attach<product>("products"); } )
.and_then( [&s] { return s.attach<order>("order"); } );
REQUIRE(result);