2022-10-25 17:08:36 -03:00
|
|
|
#include "models/entity.h"
|
|
|
|
|
2022-11-01 01:04:41 -03:00
|
|
|
const char* obelisk::Entity::createTable()
|
2022-10-25 17:08:36 -03:00
|
|
|
{
|
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)
|
|
|
|
);
|
|
|
|
)";
|
2022-10-25 17:08:36 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2022-10-25 17:08:36 -03:00
|
|
|
}
|