added basic support for containers with pointers to models

added to Model:
template<typename ContainerItemType>
void field(const wchar_t * db_field_name, const wchar_t * flat_field_name, std::list<ContainerItemType*> & field_value, const FT & field_type = FT::default_type);

template<typename ContainerItemType>
void field(const wchar_t * db_field_name, const wchar_t * flat_field_name, std::vector<ContainerItemType*> & field_value, const FT & field_type = FT::default_type);
This commit is contained in:
2021-06-17 21:31:58 +02:00
parent dc1c601eac
commit 5cf55ecce3
5 changed files with 391 additions and 339 deletions

View File

@@ -1378,7 +1378,7 @@ 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, const FT & field_type)
void Model::field_model_iterate_through_childs(Model & field_model, const FT & field_type)
{
if( model_env->model_work_submode == MORM_MODEL_WORK_SUBMODE_INSERT )
{
@@ -1618,6 +1618,7 @@ void Model::field_model(const wchar_t * db_field_name, const wchar_t * flat_fiel
}
void Model::field_model_for_db(const wchar_t * db_field_name, Model & field_model, const FT & field_type)
{
if( model_env->model_work_mode == MORM_MODEL_WORK_MODE_SET_PARENT_ID )
@@ -1632,7 +1633,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_type);
field_model_iterate_through_childs(field_model, field_type);
}
}
@@ -1640,7 +1641,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_type);
field_model_iterate_through_childs(field_model, field_type);
}
}