some work for SELECT statement

git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1077 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2018-03-30 19:34:45 +00:00
parent d84ca900c3
commit fceec43d07
16 changed files with 605 additions and 105 deletions

View File

@@ -35,6 +35,7 @@
#ifndef headerfile_morm_dbexpression
#define headerfile_morm_dbexpression
#include <vector>
#include "baseexpression.h"
#include "morm_types.h"
@@ -52,35 +53,39 @@ public:
virtual void set_output_type(int output_type);
virtual void prepare_to_where_clause();
// may better names?
virtual DbExpression & group_or();
virtual DbExpression & group_and();
virtual DbExpression & group_end();
protected:
int output_type;
std::vector<int> conjunctions;
bool can_field_be_generated(bool insertable, bool updatable, bool is_primary_key);
void field_before();
void before_field_value(const std::wstring &);
void before_field_value(const std::string &);
void after_field_value(const std::wstring &);
void before_field_value(const std::string &);
void after_field_value(const std::string &);
void before_field_value(const wchar_t *);
void after_field_value(const wchar_t *);
void before_field_value(const char *);
void after_field_value(const char *);
template<typename FieldValue>
void print_field_name_value(const wchar_t * field_name, const FieldValue & field_value)
{
put_field_name(field_name);
if( output_type == MORM_OUTPUT_TYPE_DB_PRIMARY_KEY )
{
(*out_stream) << " = ";
}
put_field_value(field_value);
}
void put_name_value_separator();
private:
@@ -89,30 +94,6 @@ private:
void after_field_value_string();
// DbExpression & eq(const wchar_t * field_name, const std::wstring & field_value)
// {
// //put_field_name(field_name);
// return *this;
// }
//
// DbExpression & eq(const wchar_t * field_name, const std::string & field_value)
// {
//
// return *this;
// }
//
// template<typename FieldValue>
// DbExpression & eq(const wchar_t * field_name, const FieldValue & field_value)
// {
// return *this;
// }
};
}