- void AppendAttributesSQLDefinition(int level, std::string& s);
- void DBExportTreeDescription();
- //
-
- // Test
- bool DBStructureIsValid();
-
- int DBQueryNumberOfChildren(tree::Node* n);
-
- // Insertion
- bool DBInsert(tree::Node* alien_node) ; //, UpdateSummary& summary);
-
- //
- std::string DBGetNodeId(tree::Node* node, const std::string& parent_id);
-
- tree::Node* GetNodeFromTypeId(int level,
- const std::string& id);
-
- //
- tree::Node* DBGetOrCreateNode(tree::Node* alien_node,
- tree::Node* internal_parent,
- std::string parentid,
- std::string& created_id);
- // UpdateSummary& summary);
-
- tree::Node* DBGetOrCreateParent(tree::Node* alien_node,
- std::string& parent_id);
- // UpdateSummary& summary);
-
- void DBRecursiveGetOrCreateNode(tree::Node* alien_node,
- tree::Node* parent,
- const std::string& parent_id);
- // UpdateSummary& summary);
-
-
- //
+ void SQLAppendAttributesDefinition(int level, std::string& s);
+ //======================================================================
+
+ //======================================================================
+
+ /// Returns the parent to which the branch defined by the attributes
+ // provided must be grafted
+ tree::Node* DBGetParent( const AttributeMapType& attr);
+ //======================================================================
+
+ //======================================================================
+
+ /// Loads the children of Node parent
+ // Can recurse to numberoflevels levels
+ // \return The total number of Node loaded (may be at different levels)
+ int DBLoadChildren( tree::Node* parent, int numberoflevels = 1);
+ //======================================================================
+
+ //======================================================================
+
+ /// Appends to string s the SQL command to set the attributes values
+ // of node n
+ void SQLAppendAttributesValues(tree::Node* n, std::string& s);
+ //======================================================================
+
+ //======================================================================
+
+ /// Graft the branch defined by the attributes to the parent
+ void DBGraftToParent( tree::Node* parent, const AttributeMapType& attr);
+ //======================================================================
+ //======================================================================
+
+ /// Sets an attribute of a Node and updates the database
+ bool DBSetAttribute(tree::Node*,
+ const std::string& key,
+ const std::string& value);
+ //======================================================================
+ //======================================================================
+ /// Sets an attribute and updates the database
+ void DBSetAttribute(const std::string& levelDescriptor,
+ const std::string& key,
+ const std::string& value,
+ const std::string& searchParam,
+ const std::string& searchVal);
+ //======================================================================
+ //======================================================================
+
+ /// Inserts the Node in the database
+ void DBInsert(tree::Node* n);
+ //======================================================================
+
+
+ //======================================================================
+
+ /// Deletes the tuple that matches the value specified in the given key and that belongs to the given level
+ void DBDelete(std::string levelDescriptor, std::string key, std::string value);
+ //======================================================================
+
+ //======================================================================
+
+ /// Recursively Removes the nodes whose parent is given as a parameter