added logging module and a sandbox project
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#ifndef BOOK_HPP
|
||||
#define BOOK_HPP
|
||||
|
||||
#include "matador/object/object_ptr.hpp"
|
||||
#include "matador/utils/access.hpp"
|
||||
|
||||
namespace demo {
|
||||
struct author;
|
||||
|
||||
struct book {
|
||||
unsigned int id{};
|
||||
matador::object::object_ptr<author> book_author;
|
||||
std::string title;
|
||||
unsigned short published_in{};
|
||||
|
||||
template<typename Operator>
|
||||
void process( Operator& op ) {
|
||||
namespace field = matador::access;
|
||||
field::primary_key( op, "id", id );
|
||||
field::attribute( op, "title", title, 511 );
|
||||
field::has_one( op, "author_id", book_author, matador::utils::default_foreign_attributes );
|
||||
field::attribute( op, "published_in", published_in );
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif //BOOK_HPP
|
||||
Reference in New Issue
Block a user