removed: set_connector_for_childs from ModelConnector

changed: model connector is propagated to childs when needed
         (when update, insert, save, to_text is called or in finder)




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1120 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2018-07-04 13:52:40 +00:00
parent 08cd621d41
commit d6e428d929
6 changed files with 14 additions and 41 deletions

View File

@@ -473,7 +473,10 @@ protected:
if( flat_expression && !is_empty_field(flat_field_name) )
{
flat_expression->field_list(flat_field_name, field_list, insertable, updatable, is_primary_key, model_connector_mode);
// IMPROVE ME
// what about model_data and save_mode?
// may it should be placed inside some structure?
flat_expression->field_list(flat_field_name, field_list, insertable, updatable, is_primary_key, model_connector, model_connector_mode);
}
}
}
@@ -482,21 +485,16 @@ protected:
{
field_list.clear();
}
// WILL BE REMOVED
if( model_connector_mode == MORM_MODEL_CONNECTOR_MODE_SETTING_CONNECTOR_FOR_CHILDS )
{
// IMPROVE ME
// it would be better to set the connector when an operation is needed
}
}
}
template<typename ModelX>
void field_model(const wchar_t * db_field_name, const wchar_t * flat_field_name, ModelX & field_model, bool insertable, bool updatable, bool is_primary_key)
void field_model(const wchar_t * db_field_name, const wchar_t * flat_field_name, Model & field_model, bool insertable, bool updatable, bool is_primary_key)
{
if( model_connector )
{
field_model.set_connector(model_connector);
// IMPLEMENTME what about db?
if( model_connector_mode == MORM_MODEL_CONNECTOR_MODE_GENERATING_FLAT_STRING )
{
@@ -519,12 +517,6 @@ protected:
{
field_model.clear();
}
// WILL BE REMOVED
if( model_connector_mode == MORM_MODEL_CONNECTOR_MODE_SETTING_CONNECTOR_FOR_CHILDS )
{
field_model.set_connector(model_connector);
}
}
}
@@ -599,8 +591,6 @@ protected:
template<typename ModelClass> friend class Finder;
friend class BaseExpression;
// WILL BE REMOVED when ModelConnector::set_connector_for_childs(Model & model) will be removed
friend class ModelConnector;
};
} // namespace