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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user