added join_column_collector and implemented inverse has_many_to_many

This commit is contained in:
2024-04-14 22:12:48 +02:00
parent 7bb7afa227
commit fb57545cce
6 changed files with 206 additions and 24 deletions
+28
View File
@@ -0,0 +1,28 @@
#ifndef QUERY_ORDER_DETAILS_HPP
#define QUERY_ORDER_DETAILS_HPP
#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_HPP