mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 03:38:03 +08:00
Remove 'setter' methods of auto-increasing columns
This commit is contained in:
parent
143b62b36b
commit
16d6caedb0
@ -58,7 +58,8 @@ const std::string {{className}}::tableName = "{{tableName}}";
|
||||
$$<<" return _"<<col._colValName<<";\n";
|
||||
$$<<"}\n";
|
||||
|
||||
|
||||
if(!col._isAutoVal)
|
||||
{
|
||||
$$<<"void "<<className<<"::set"<<col._colTypeName<<"(const "<<col._colType<<" &"<<col._colValName<<") noexcept\n";
|
||||
$$<<"{\n";
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<"<<col._colType<<">("<<col._colValName<<");\n";
|
||||
@ -72,7 +73,7 @@ const std::string {{className}}::tableName = "{{tableName}}";
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<"<<col._colType<<">(std::move("<<col._colValName<<"));\n";
|
||||
$$<<"}\n";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$$<<"\n";
|
||||
}
|
||||
|
@ -44,9 +44,12 @@ class {{className}}
|
||||
{
|
||||
$$<<" const "<<col._colType<<" &getValueOf"<<col._colTypeName<<"(const "<<col._colType<<" &defaultValue="<<col._colType<<"()) const noexcept;\n";
|
||||
$$<<" std::shared_ptr<const "<<col._colType<<"> get"<<col._colTypeName<<"() const noexcept;\n";
|
||||
if(!col._isAutoVal)
|
||||
{
|
||||
$$<<" void set"<<col._colTypeName<<"(const "<<col._colType<<" &"<<col._colValName<<") noexcept;\n";
|
||||
if(col._colType=="std::string")
|
||||
$$<<" void set"<<col._colTypeName<<"("<<col._colType<<" &&"<<col._colValName<<") noexcept;\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
$$<<" //FIXME!!"<<" getValueOf"<<col._colTypeName<<"() const noexcept;\n";
|
||||
|
Loading…
Reference in New Issue
Block a user