obelisk/src/models/entity.cpp

33 lines
532 B
C++
Raw Normal View History

#include "models/entity.h"
2022-11-01 01:04:41 -03:00
const char* obelisk::Entity::createTable()
{
2022-11-01 01:04:41 -03:00
return R"(
CREATE TABLE "entity" (
"id" INTEGER NOT NULL UNIQUE,
"name" TEXT NOT NULL CHECK(trim(name) != '') UNIQUE,
PRIMARY KEY("id" AUTOINCREMENT)
);
)";
}
int obelisk::Entity::getId()
{
return id_;
}
void obelisk::Entity::setId(int id)
{
id_ = id;
}
std::string obelisk::Entity::getName()
{
return name_;
}
void obelisk::Entity::setName(std::string name)
{
2022-11-01 01:04:41 -03:00
name_ = name;
}