#ifndef QUERY_ENTITY_QUERY_BUILDER_HPP #define QUERY_ENTITY_QUERY_BUILDER_HPP #include "matador/sql/query_context.hpp" namespace matador::sql { template < typename PrimaryKeyType > class entity_query_builder { public: // determine pk // collect eager relations for joins template query_context build() { EntityType obj; matador::utils::access::process(*this, obj); return {}; } template < class V > void on_primary_key(const char *id, V &, typename std::enable_if::value && !std::is_same::value>::type* = 0) { } void on_primary_key(const char *id, std::string &, size_t) { } void on_revision(const char * /*id*/, unsigned long long &/*rev*/) {} template void on_attribute(const char * /*id*/, Type &, const utils::field_attributes &/*attr*/ = utils::null_attributes) {} template void on_belongs_to(const char *id, Pointer &, const utils::foreign_attributes &/*attr*/) { } template void on_has_one(const char *id, Pointer &, const utils::foreign_attributes &attr) { } template void on_has_many(const char *, ContainerType &, const char *, const char *, const utils::foreign_attributes &attr) { } template void on_has_many(const char *id, ContainerType &c, const utils::foreign_attributes &attr) { on_has_many(id, c, "", "", attr); } private: PrimaryKeyType pk_; }; } #endif //QUERY_ENTITY_QUERY_BUILDER_HPP