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:
@@ -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 )
|
||||
{
|
||||
|
Reference in New Issue
Block a user