query/demo/work/jobs/Payload.hpp

30 lines
748 B
C++

#ifndef PAYLOAD_HPP
#define PAYLOAD_HPP
#include "../core/Model.hpp"
#include "matador/query/meta_table_macro.hpp"
#include "matador/utils/base_class.hpp"
#include "matador/utils/foreign_attributes.hpp"
namespace work::models::jobs {
struct Job;
struct Payload : core::Model {
std::string type{};
matador::object::object_ptr<Job> job{};
template<typename Operator>
void process( Operator& op ) {
namespace field = matador::access;
field::process( op, *matador::base_class<Model>( this ) );
field::attribute( op, "type", type, 255 );
field::belongs_to( op, "job", job, matador::utils::CascadeAllFetchLazy );
}
};
}
META_TABLE(payloads, PAYLOAD, id, version, type, job)
#endif //PAYLOAD_HPP