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:
@@ -32,9 +32,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ctime>
|
||||
#include "basesample.h"
|
||||
#include "person.h"
|
||||
#include "language.h"
|
||||
#include "attachment.h"
|
||||
|
||||
|
||||
namespace morm
|
||||
@@ -52,6 +54,9 @@ void make()
|
||||
person.set_connector(model_connector);
|
||||
load_defaults(person);
|
||||
|
||||
std::wstring sss = L"cosik";
|
||||
person.set_field_value_generic(L"email", L"email", sss);
|
||||
|
||||
person.insert();
|
||||
}
|
||||
|
||||
@@ -75,6 +80,14 @@ private:
|
||||
person.language.local_name = L"polish";
|
||||
person.language.code_str = L"en";
|
||||
person.language.code_int = 200;
|
||||
|
||||
std::time_t t = std::time(0);
|
||||
|
||||
person.attachment.person_id = -1;
|
||||
person.attachment.created_date.FromTime(t);
|
||||
person.attachment.name = L"attchment name";
|
||||
person.attachment.content = "long binary content";
|
||||
person.attachment.some_flags = true;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user