winix_fullmorm #4
15
src/ft.h
15
src/ft.h
|
@ -56,10 +56,11 @@ public:
|
|||
no_insertable = 8,
|
||||
no_updatable = 16,
|
||||
no_fetchable = 32, /* not supported yet */
|
||||
raw_field_name = 64,
|
||||
dont_use_utf8 = 128,
|
||||
hexadecimal = 256,
|
||||
binary = 512,
|
||||
no_removable = 64,
|
||||
raw_field_name = 128,
|
||||
dont_use_utf8 = 256,
|
||||
hexadecimal = 512,
|
||||
binary = 1024,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -122,18 +123,20 @@ public:
|
|||
return !is_flag_set(no_insertable);
|
||||
}
|
||||
|
||||
|
||||
bool is_updatable() const
|
||||
{
|
||||
return !is_flag_set(no_updatable);
|
||||
}
|
||||
|
||||
|
||||
bool is_fetchable() const
|
||||
{
|
||||
return !is_flag_set(no_fetchable);
|
||||
}
|
||||
|
||||
bool is_removable() const
|
||||
{
|
||||
return !is_flag_set(no_removable);
|
||||
}
|
||||
|
||||
bool is_raw_field_name() const
|
||||
{
|
||||
|
|
|
@ -1258,27 +1258,35 @@ void Model::field_model_set_parent_key(const wchar_t * db_field_name, Model & fi
|
|||
}
|
||||
|
||||
|
||||
void Model::field_model_iterate_through_childs(const wchar_t * db_field_name, Model & field_model)
|
||||
void Model::field_model_iterate_through_childs(const wchar_t * db_field_name, Model & field_model, const FT & field_type)
|
||||
{
|
||||
if( model_env->model_work_submode == MORM_MODEL_WORK_SUBMODE_INSERT )
|
||||
{
|
||||
if( field_type.is_insertable() )
|
||||
field_model.insert_tree(true);
|
||||
}
|
||||
|
||||
if( model_env->model_work_submode == MORM_MODEL_WORK_SUBMODE_UPDATE )
|
||||
{
|
||||
if( field_type.is_updatable() )
|
||||
field_model.update_tree(true);
|
||||
}
|
||||
|
||||
if( model_env->model_work_submode == MORM_MODEL_WORK_SUBMODE_REMOVE )
|
||||
{
|
||||
if( field_type.is_removable() )
|
||||
field_model.remove_tree(true);
|
||||
}
|
||||
|
||||
if( model_env->model_work_submode == MORM_MODEL_WORK_SUBMODE_SAVE )
|
||||
{
|
||||
if( (field_model.save_mode == Model::DO_INSERT_ON_SAVE && field_type.is_insertable()) ||
|
||||
(field_model.save_mode == Model::DO_UPDATE_ON_SAVE && field_type.is_updatable()) ||
|
||||
(field_model.save_mode == Model::DO_DELETE_ON_SAVE && field_type.is_removable()) )
|
||||
{
|
||||
field_model.save_tree(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1483,7 +1491,7 @@ void Model::field_model_for_db(const wchar_t * db_field_name, Model & field_mode
|
|||
{
|
||||
if( field_type.is_foreign_key() )
|
||||
{
|
||||
field_model_iterate_through_childs(db_field_name, field_model);
|
||||
field_model_iterate_through_childs(db_field_name, field_model, field_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1491,7 +1499,7 @@ void Model::field_model_for_db(const wchar_t * db_field_name, Model & field_mode
|
|||
{
|
||||
if( field_type.is_foreign_key_in_child() )
|
||||
{
|
||||
field_model_iterate_through_childs(db_field_name, field_model);
|
||||
field_model_iterate_through_childs(db_field_name, field_model, field_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -643,7 +643,7 @@ protected:
|
|||
void field_model_save_key(const wchar_t * db_field_name);
|
||||
void field_model_set_parent_key_in_child(const wchar_t * db_field_name, Model & field_model);
|
||||
void field_model_set_parent_key(const wchar_t * db_field_name, Model & field_model);
|
||||
void field_model_iterate_through_childs(const wchar_t * db_field_name, Model & field_model);
|
||||
void field_model_iterate_through_childs(const wchar_t * db_field_name, Model & field_model, const FT & field_type);
|
||||
void field_model_generate_flat_string(const wchar_t * flat_field_name, Model & field_model, const FT & field_type);
|
||||
void field_model_generate_db_sql(const wchar_t * db_field_name, Model & field_model, const FT & field_type);
|
||||
void field_model_clear_values(Model & field_model);
|
||||
|
|
Loading…
Reference in New Issue