some work: we need a different way of naming tables for joins

git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1187 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2019-03-26 20:35:05 +00:00
parent 9c7a0f3d7e
commit ab54a3fc3e
8 changed files with 181 additions and 22 deletions

View File

@@ -105,6 +105,40 @@ void Model::table_name(PT::TextStream & stream)
}
// the body can be moved to dbexpression
// the algorithm can be different depending on the database used
void Model::table_name_for_join_as(PT::TextStream & stream)
{
PT::TextStream str_temp;
table_name(str_temp);
// temporarily
std::string str;
str_temp.to_string(str);
size_t i = str.size();
while( i-- > 0 )
{
if( str[i] == '.' )
{
break;
}
}
if( str[i] == '.' )
{
i += 1;
}
for( ; i < str.size() ; ++i)
{
stream << str[i];
}
}
void Model::set_connector(ModelConnector & connector)
{
set_connector(&connector);
@@ -426,7 +460,7 @@ bool Model::save(ModelData & model_data)
}
void Model::generate_select_columns(PT::TextStream & stream, const std::wstring & column_prefix, ModelData * model_data)
void Model::generate_select_columns(PT::TextStream & stream, const std::string & column_prefix, ModelData * model_data)
{
if( model_connector )
{