Commit 14ac33fc authored by Casualet's avatar Casualet

move function serilize to DBMeta

parent 1ddccdb1
...@@ -125,7 +125,7 @@ public: ...@@ -125,7 +125,7 @@ public:
// FIXME: This should possibly be a part of DBMeta. // FIXME: This should possibly be a part of DBMeta.
// > Parent will definitely be DBMeta. // > Parent will definitely be DBMeta.
// > Parent-Child semantics aren't really added until DBMeta. // > Parent-Child semantics aren't really added until DBMeta.
virtual std::string serialize(const DBObject &parent) const = 0;
}; };
class Connect; class Connect;
...@@ -159,7 +159,7 @@ public: ...@@ -159,7 +159,7 @@ public:
applyToChildren(std::function<bool(const DBMeta &)>) const = 0; applyToChildren(std::function<bool(const DBMeta &)>) const = 0;
/*traverse the map to get the key for the conresponding child(reference MappedDBMeta)*/ /*traverse the map to get the key for the conresponding child(reference MappedDBMeta)*/
virtual AbstractMetaKey const &getKey(const DBMeta &child) const = 0; virtual AbstractMetaKey const &getKey(const DBMeta &child) const = 0;
virtual std::string serialize(const DBObject &parent) const = 0;
protected: protected:
std::vector<DBMeta*> std::vector<DBMeta*>
doFetchChildren(const std::unique_ptr<Connect> &e_conn, doFetchChildren(const std::unique_ptr<Connect> &e_conn,
......
...@@ -527,6 +527,7 @@ std::vector<FieldMeta *> TableMeta::orderedFieldMetas() const ...@@ -527,6 +527,7 @@ std::vector<FieldMeta *> TableMeta::orderedFieldMetas() const
return v; return v;
} }
/*use fm->hasDefault() to test whether the filed has default value*/
std::vector<FieldMeta *> TableMeta::defaultedFieldMetas() const std::vector<FieldMeta *> TableMeta::defaultedFieldMetas() const
{ {
std::vector<FieldMeta *> v; std::vector<FieldMeta *> v;
......
...@@ -184,6 +184,7 @@ public: ...@@ -184,6 +184,7 @@ public:
std::string serialize(const DBObject &parent) const; std::string serialize(const DBObject &parent) const;
std::string getAnonTableName() const; std::string getAnonTableName() const;
std::vector<FieldMeta *> orderedFieldMetas() const; std::vector<FieldMeta *> orderedFieldMetas() const;
/* return fieldmeta of fields that has default value */
std::vector<FieldMeta *> defaultedFieldMetas() const; std::vector<FieldMeta *> defaultedFieldMetas() const;
TYPENAME("tableMeta") TYPENAME("tableMeta")
std::string getAnonIndexName(const std::string &index_name, std::string getAnonIndexName(const std::string &index_name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment