#ifndef QUERY_ORDER_DETAILS_HPP #define QUERY_ORDER_DETAILS_HPP #include "product.hpp" #include "matador/object/collection.hpp" #include "matador/object/object_ptr.hpp" #include "matador/utils/foreign_attributes.hpp" namespace matador::test { struct order; struct order_details { unsigned int order_details_id; object::object_ptr order_; object::collection> products_; template 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_many(op, "order_products", products_, "product_id", utils::CascadeNoneFetchLazy); } }; } #endif //QUERY_ORDER_DETAILS_HPP