fixed: update/insert for child models generated an incorrect query (blocked for a while)

git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1201 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2019-08-21 12:15:55 +00:00
parent f8d88d1459
commit 265197ce47
1 changed files with 7 additions and 2 deletions

View File

@ -826,7 +826,9 @@ protected:
field_model_left_join(db_field_name, flat_field_name, field_model, insertable, updatable, has_foreign_key, db_expression);
}
if( db_expression->get_output_type() != MORM_OUTPUT_TYPE_JOIN_TABLES )
if( db_expression->get_output_type() != MORM_OUTPUT_TYPE_JOIN_TABLES &&
db_expression->get_output_type() != MORM_OUTPUT_TYPE_DB_INSERT &&
db_expression->get_output_type() != MORM_OUTPUT_TYPE_DB_UPDATE )
{
// FIX ME
// UPDATE, INSERT, REMOVE for models
@ -958,7 +960,10 @@ protected:
{
DbExpression * db_expression = db_connector->get_expression();
if( db_expression && !is_empty_field(db_field_name) && db_expression->get_output_type() != MORM_OUTPUT_TYPE_JOIN_TABLES )
if( db_expression && !is_empty_field(db_field_name) &&
db_expression->get_output_type() != MORM_OUTPUT_TYPE_JOIN_TABLES &&
db_expression->get_output_type() != MORM_OUTPUT_TYPE_DB_INSERT &&
db_expression->get_output_type() != MORM_OUTPUT_TYPE_DB_UPDATE )
{
// another select will be used (from another Finder)
// we need only columns name