added: to Model: virtual void set_parent_key_in_childs()

for setting a parent key id in child models,
       it is called after after_insert() method
added: SetFieldValueHelper class used for storing primary key values from a parent model




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1204 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2019-08-22 18:33:35 +00:00
parent 52422d929e
commit 7ff05f493c
10 changed files with 571 additions and 32 deletions

View File

@@ -38,6 +38,8 @@
#include <string>
#include "morm.h"
#include "language.h"
#include "attachment.h"
namespace morm
@@ -67,14 +69,21 @@ public:
std::wstring email;
Language language;
Attachment attachment;
void map_fields()
{
field(L"id", id, false, false, true);
//field(L"id", id, f::no_insertable | f::no_updatable | f::primary_key);
field(L"first_name", first_name);
field(L"last_name", last_name);
field(L"email", email);
field(L"language_id", language);
field(L"person_id", attachment, true, true, false);
//field(L"person_id", attachment, f::insertable | f::updatable | f::foreign_key);
//field(L"person_id", attachment, f::insertable, f::updatable, f::foreign_key);
}
void table_name(PT::TextStream & stream)