added: support for generating LEFT JOIN statement in Finder

(the primary key should consist of only one column at the moment)



git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1186 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2019-03-26 18:34:07 +00:00
parent 440f56e376
commit 9c7a0f3d7e
10 changed files with 266 additions and 70 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2018, Tomasz Sowa
* Copyright (c) 2018-2019, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -60,6 +60,12 @@ void BaseExpression::set_work_mode(int work_mode)
}
int BaseExpression::get_work_mode()
{
return work_mode;
}
void BaseExpression::prepare_to_new_expression()
{
column_prefix.clear();
@@ -144,10 +150,16 @@ void BaseExpression::field_after()
}
void BaseExpression::put_field_name(const wchar_t * field_name, bool add_column_prefix)
void BaseExpression::put_field_name(int table_index, const wchar_t * field_name, bool add_column_prefix)
{
before_field_name();
if( table_index >= 0 )
{
(*out_stream) << 't' << table_index << '.';
}
if( add_column_prefix && !column_prefix.empty() )
{
esc(column_prefix, *out_stream);
@@ -159,6 +171,11 @@ void BaseExpression::put_field_name(const wchar_t * field_name, bool add_column_
}
void BaseExpression::put_field_name(const wchar_t * field_name, bool add_column_prefix)
{
put_field_name(-1, field_name, add_column_prefix);
}
void BaseExpression::put_field_doc(Model & model, const void * field_pointer, bool insertable, bool updatable, bool is_primary_key, ModelData * model_data)