added BaseExpression::is_long_field_name()

added BaseExpression::need_to_add_field_prefix()
      now the fields() methods don't take add_column_prefix parameter
      but the field_name (wchar_t*) is tested whether is it a long (with a period) or short name
added BaseExpression::save_foreign_key() (code moved from field())
removed some default method arguments from BaseExpression
added neq() method for Finder
added DbExpression::prepare_short_table_name(const PT::TextStream & table_name, PT::TextStream & short_table_name)




git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1194 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2019-05-31 18:28:09 +00:00
parent a1d18735b0
commit b6fbe29805
13 changed files with 286 additions and 205 deletions

View File

@@ -140,6 +140,11 @@ void DbExpression::put_name_value_separator()
(*out_stream) << " = ";
}
else
if( output_type == MORM_OUTPUT_TYPE_WHERE_NOT_EQ )
{
(*out_stream) << " <> ";
}
else
if( output_type == MORM_OUTPUT_TYPE_WHERE_LT )
{
(*out_stream) << " < ";
@@ -296,4 +301,40 @@ DbExpression & DbExpression::page(PT::TextStream & stream, size_t page_number, s
return *this;
}
void DbExpression::prepare_short_table_name(const PT::TextStream & table_name, PT::TextStream & short_table_name)
{
short_table_name.clear();
if( is_long_table_name(table_name) )
{
PT::TextStream::const_iterator i = table_name.begin();
bool was_dot = false;
while( i != table_name.end() )
{
if( was_dot )
{
short_table_name << *i;
}
else
if( *i == '.' )
{
was_dot = true;
}
++i;
}
}
if( short_table_name.empty() )
{
short_table_name = table_name;
}
}
}