class CTNORM
{
public:
CTNORM();
~CTNORM();
void setTable(const string& sTable);
string table();
string getORM();
bool fromString(const string& sORMDefine);
bool exist(const string& sField);
int rpc();
int query(const string& sFields, CIntent& itWhere, CSelectHelp& help);
int queryAll(CIntent& itWhere, CSelectHelp& help);
bool update(CIntent& itSet, CIntent& itWhere);
bool del(CIntent& itWhere);
bool insert(CIntent& it);
bool insertAll(CIntent& it);
string error();
void callError(const string& sMsg);
void enableLog(bool bEnable);
string getOtlType(const string& sType);
string getType(const string& sField);
void dump();
void setDB(int idx);
void setDBLuaProcess(CDBLuaProcess& db);
string getQuerySQL(bool bNeedWhere);
string getUpdateSQL(bool bNeedWhere);
void getKS(CselectHelp& help);
void getFields (CSelectHelp& help);
bool batchUpdateAndInsert(CIntent& vUpdate, CIntent& vInsert, CSelectHelp& help, CTNString& sReturnErr,int iOneSplit = 300);
bool batchUpdateAndInsertAll(CSelectHelp& help, CTNString& sReturnErr, int iOneSplit = 300);
bool update(const string& sTable, CSelectHelp& help, const string& keys,CIntent& itOption=CIntent());
bool insert(const string& sTable, CSelectHelp& help, CSelectHelp& helpAutoID=CSelectHelp());
bool del(const string& sTable, CSelectHelp& help, const string& keys, CIntent& itOption = CIntent());
bool ormFlow(CIntent& itFlow, CSelectHelp& resultHelp, CIntent& itOption = CIntent());
};