some work in morm
- support for fetching rows from db - support for inserting/updating rows git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1081 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -63,15 +63,21 @@ void BaseExpression::set_work_mode(int work_mode)
|
||||
void BaseExpression::generate_from_model(PT::TextStream & stream, Model & model)
|
||||
{
|
||||
this->out_stream = &stream;
|
||||
|
||||
before_generate_from_model();
|
||||
model.map_fields();
|
||||
after_generate_from_model();
|
||||
|
||||
generate_from_model(model);
|
||||
this->out_stream = nullptr;
|
||||
}
|
||||
|
||||
|
||||
void BaseExpression::generate_from_model(Model & model)
|
||||
{
|
||||
if( out_stream )
|
||||
{
|
||||
before_generate_from_model();
|
||||
model.map_fields();
|
||||
after_generate_from_model();
|
||||
}
|
||||
}
|
||||
|
||||
void BaseExpression::before_generate_from_model()
|
||||
{
|
||||
is_first_field = true;
|
||||
@@ -161,6 +167,14 @@ void BaseExpression::after_field_value(const char *)
|
||||
{
|
||||
}
|
||||
|
||||
void BaseExpression::before_field_value(const PT::Date &)
|
||||
{
|
||||
}
|
||||
|
||||
void BaseExpression::after_field_value(const PT::Date &)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
void BaseExpression::put_name_value_separator()
|
||||
@@ -315,7 +329,7 @@ void BaseExpression::esc(void* val, PT::TextStream & stream)
|
||||
|
||||
void BaseExpression::esc(const PT::Date & date, PT::TextStream & stream)
|
||||
{
|
||||
stream << "'" << date << "'";
|
||||
stream << date;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user