fixed has one definitions
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "product.hpp"
|
||||
|
||||
#include "matador/object/collection.hpp"
|
||||
#include "matador/object/object_ptr.hpp"
|
||||
|
||||
#include "matador/utils/foreign_attributes.hpp"
|
||||
@@ -13,14 +14,14 @@ struct order;
|
||||
struct order_details {
|
||||
unsigned int order_details_id;
|
||||
object::object_ptr<order> order_;
|
||||
object::object_ptr<product> product_;
|
||||
object::collection<object::object_ptr<product>> products_;
|
||||
|
||||
template<class Operator>
|
||||
void process(Operator &op) {
|
||||
namespace field = matador::access;
|
||||
field::primary_key(op, "order_details_id", order_details_id);
|
||||
field::belongs_to(op, "order_id", order_, utils::CascadeNoneFetchLazy);
|
||||
field::has_one(op, "product_id", product_, utils::CascadeNoneFetchLazy);
|
||||
field::has_many(op, "order_products", products_, "product_id", utils::CascadeNoneFetchLazy);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user