/** * * {{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 {{className}}::primaryKeyName = "{{priKeyName}}"; <%c++ if(@@.get("hasPrimaryKey",false)){%> const bool {{className}}::hasPrimaryKey = true; <%c++ }else{%> const bool {{className}}::hasPrimaryKey = false; <%c++}%> const std::string {{className}}::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("<