renamed in Models: map_fields() to fields(), prepare_table() to table()

This commit is contained in:
Tomasz Sowa 2021-05-13 03:29:41 +02:00
parent e64bd1fba8
commit ee354d2ded
7 changed files with 22 additions and 23 deletions

View File

@ -59,15 +59,15 @@ public:
} }
void map_fields() void fields()
{ {
field(L"id", id, morm::FT::no_insertable | morm::FT::no_updatable | morm::FT::primary_key); field(L"id", id, morm::FT::no_insertable | morm::FT::no_updatable | morm::FT::primary_key);
field(L"name", name); field(L"name", name);
} }
void prepare_table() void table()
{ {
table(L"core", L"group"); table_name(L"core", L"group");
} }
void after_insert() void after_insert()

View File

@ -50,7 +50,7 @@ Item::Item()
void Item::map_fields() void Item::fields()
{ {
//ItemModelData * item_model_data = dynamic_cast<ItemModelData>(get_model_data()); //ItemModelData * item_model_data = dynamic_cast<ItemModelData>(get_model_data());
@ -70,9 +70,9 @@ void Item::map_fields()
} }
void Item::prepare_table() void Item::table()
{ {
table(L"core", L"item"); table_name(L"core", L"item");
} }

View File

@ -54,18 +54,18 @@ class CalcItemsHelper : public morm::Model
public: public:
long size; long size;
long item_id; long item_id;
void map_fields()
void fields()
{ {
field(L"size", size); field(L"size", size);
field(L"item_id", item_id); field(L"item_id", item_id);
} }
void prepare_table() void table()
{ {
table(L"core", L"item"); table_name(L"core", L"item");
} }
}; };
@ -146,8 +146,8 @@ public:
Item(); Item();
void map_fields(); void fields();
void prepare_table(); void table();
void before_insert(); void before_insert();
void after_insert(); void after_insert();

View File

@ -51,7 +51,7 @@ ItemContent::ItemContent()
void ItemContent::map_fields() void ItemContent::fields()
{ {
int content_raw_type_helper = static_cast<int>(content_raw_type); int content_raw_type_helper = static_cast<int>(content_raw_type);
int content_parsed_type_helper = static_cast<int>(content_parsed_type); int content_parsed_type_helper = static_cast<int>(content_parsed_type);
@ -86,9 +86,9 @@ void ItemContent::map_fields()
} }
void ItemContent::prepare_table() void ItemContent::table()
{ {
table(L"core", L"content"); table_name(L"core", L"content");
} }

View File

@ -212,8 +212,8 @@ public:
ItemContent(); ItemContent();
void map_fields(); void fields();
void prepare_table(); void table();
void after_insert(); void after_insert();

View File

@ -49,7 +49,7 @@ User::User()
void User::map_fields() void User::fields()
{ {
field(L"id", id, morm::FT::no_insertable | morm::FT::no_updatable | morm::FT::primary_key); field(L"id", id, morm::FT::no_insertable | morm::FT::no_updatable | morm::FT::primary_key);
field(L"login", name); // IMPROVEME set the same name, either 'login' or 'name' field(L"login", name); // IMPROVEME set the same name, either 'login' or 'name'
@ -71,9 +71,9 @@ void User::map_fields()
} }
void User::prepare_table() void User::table()
{ {
table(L"core", L"user"); table_name(L"core", L"user");
} }

View File

@ -129,11 +129,10 @@ public:
std::vector<long> groups; std::vector<long> groups;
User(); User();
void map_fields(); void fields();
void prepare_table(); void table();
void after_insert(); void after_insert();
void after_select(); void after_select();