query/test/models/order_details.h

29 lines
658 B
C++

#ifndef QUERY_ORDER_DETAILS_H
#define QUERY_ORDER_DETAILS_H
#include "product.hpp"
#include "matador/sql/entity.hpp"
namespace matador::test {
struct order;
struct order_details
{
unsigned long order_details_id;
sql::entity<order> order_;
sql::entity<product> product_;
template<class Operator>
void process(Operator &op) {
namespace field = matador::utils::access;
field::primary_key(op, "order_details_id", order_details_id);
field::belongs_to(op, "order_id", order_, utils::default_foreign_attributes);
field::has_one(op, "product_id", product_, utils::default_foreign_attributes);
}
};
}
#endif //QUERY_ORDER_DETAILS_H