#include <SQLPredicateTree.h>
Inheritance diagram for LcgInfo::SQLPredicateTree:
Public Methods | |
SQLPredicateTree () | |
Constructor of the class. More... | |
virtual | ~SQLPredicateTree () |
Destructor of the class. | |
virtual SQLPredicateTree * | create ()=0 |
Creates a new node of the type of the node. More... | |
virtual SQLPredicateTree * | clone ()=0 |
Recursively copies this node and all the nodes below it. More... | |
virtual void | insertPredicate (std::string const &pPred) |
Modifies this node, creates the necessary children and passes them the appropriate sub-predicates, to make the tree of which this node is the root represent the specified SQL WHERE predicate. More... | |
virtual std::string | evaluate (std::vector< std::string > &pQueries)=0 |
Returns the predicate (and possibly list of necessary subqueries) resulting of evaluating this node and all its descendants. More... | |
Protected Methods | |
virtual std::string | getCHARS_TO_TOKENIZE_PREDICATES () |
Returns the chars to be used as delimiters when tokenizing predicates to be added to a PredicateTree, in order to parse the table names to be added to the new list of tables for the resulting query. More... | |
Static Protected Attributes | |
std::string const | CHARS_TO_ESCAPE_IN_SQL_LITERALS = "\t ><=!()" |
Each object is a node linked to its two children nodes (left and right). This class extends the PredicateTree, and overloads the insertPredicate() method, so that the predicate can be built using SQL as query language. Extending classes will overload the evaluate() method and thus define the output query language.
Definition at line 23 of file SQLPredicateTree.h.
|
Constructor of the class. It just creates an empty object. Definition at line 18 of file SQLPredicateTree.cpp. |
|
Recursively copies this node and all the nodes below it. The resulting object's dynamic type will be that of the extending class redefining this method It is a trick (similar to a virtual copy constructor) used to allow the recursive copy of the tree.
Implements LcgInfo::PredicateTree. Implemented in LcgInfo::SQLtoLDAPPredicateTree. |
|
Creates a new node of the type of the node. It uses some default values (in order to use a template, use the PredicateTree::clone() method). As said, the object's dynamic type will be that of the extending class redefining this method. It is a trick (virtual constructor) used to allow the recursive creation of the tree when inserting predicates.
Implements LcgInfo::PredicateTree. Implemented in LcgInfo::SQLtoLDAPPredicateTree. Referenced by insertPredicate. |
|
Returns the predicate (and possibly list of necessary subqueries) resulting of evaluating this node and all its descendants. Extending classes implementing this method will specify the query language used in the output. It may throw a QueryTranslationException if the node (or one of its children) cannot be parsed properly.
Implements LcgInfo::PredicateTree. Implemented in LcgInfo::SQLtoLDAPPredicateTree. |
|
Returns the chars to be used as delimiters when tokenizing predicates to be added to a PredicateTree, in order to parse the table names to be added to the new list of tables for the resulting query. It is used by the PredicateTree::addAndPredicate() method. Reimplemented from LcgInfo::PredicateTree. Definition at line 154 of file SQLPredicateTree.cpp. |
|
Modifies this node, creates the necessary children and passes them the appropriate sub-predicates, to make the tree of which this node is the root represent the specified SQL WHERE predicate. It may throw an QueryTranslationException, if the predicate is not well-formed.
Implements LcgInfo::PredicateTree. Definition at line 25 of file SQLPredicateTree.cpp. References create, LcgInfo::delSurroundingChars, LcgInfo::escapeLiterals, LcgInfo::PredicateTree::left, LcgInfo::PredicateTree::right, LcgInfo::PredicateTree::setLeft, and LcgInfo::PredicateTree::setRight. |