/** * * {{className}}.cc * created by drogon_ctl * */ <%inc#include "create_model.h" using namespace drogon_ctl; %> #include "{{className}}.h" #include using namespace drogon_model::{{dbname}}; const std::string User::primaryKeyName = "{{priKeyName}}"; <%c++ if(@@.get("hasPrimaryKey",false)){%> const bool User::hasPrimaryKey = true; <%c++ }else{%> const bool User::hasPrimaryKey = false; <%c++}%> const std::string User::tableName = "{{tableName}}"; <%c++ auto cols=@@.get>("columns"); auto className=@@.get("className"); %> {{className}}::{{className}}(const Row &r) noexcept { <%c++ for(auto col:cols) { if(col._colType.empty()) continue; %> if(!r["<%c++$$<"].isNull()) { _<%c++$$<=std::make_shared<<%c++$$<>(r["<%c++$$<"].as<<%c++$$<>()); } <%c++ } %> } <%c++ for(auto col:cols) { if(!col._colType.empty()) { $$<<"const "< "<("<(std::move("<