#include <SQLQueryTranslator.h>
Inheritance diagram for LcgInfo::SQLQueryTranslator:
Public Methods | |
SQLQueryTranslator () | |
Constructor using "./mappingGlueRMA" as the default name for the mapfile. More... | |
SQLQueryTranslator (std::string const &pMapFile) | |
Constructor passing the name of the file that has to be used for the mapping. More... | |
SQLQueryTranslator (LcgConfigBuffer::ConfigBuffer &pMap) | |
Constructor passing a reference to the already existing LcgConfigBuffer::ConfigBuffer object that is used for the mapping. More... | |
virtual | ~SQLQueryTranslator () |
Destructor of the class. | |
virtual std::vector< std::string > | translateQuery (std::string const &pQueryCanonical)=0 |
Translates the specified query (intended to be posed to the canonical schema) into some new queries that can be posed to the implementation specific schema (in order) to retrieve the same information. More... | |
void | translateSemantic (std::string const &pQueryCanonical, SQLPredicateTree &pPred, std::vector< std::string > &pRowsToReturn, std::set< std::string > &pNewTableList) |
Makes the semantic translation of the specified query (intended to be posed to the canonical schema). More... | |
Static Protected Attributes | |
std::string const | CHARS_TO_DIVIDE_SQL_WORDS = "\t ," |
std::string const | CHARS_POSSIBLY_ESCAPED = "%" |
The equivalent schema is mapped to the canonical one using a mapping file (whose syntax must conform to that defined in ...) The query language used to express the original query must be SQL and the one for the resulting query will be defined in classes extending this one. For instance a SQLtoLDAPQueryTranslator would implement the virtual methods here defined for the SQL query language as input an LDAP query language as output.
Definition at line 32 of file SQLQueryTranslator.h.
|
Constructor using "./mappingGlueRMA" as the default name for the mapfile. It may throw a QueryTranslationException if the specified mapping file cannot be loaded. Please do not use this constructor. Definition at line 16 of file SQLQueryTranslator.cpp. |
|
Constructor passing the name of the file that has to be used for the mapping. It may throw a QueryTranslationException if the specified mapping file cannot be loaded.
Definition at line 20 of file SQLQueryTranslator.cpp. |
|
Constructor passing a reference to the already existing LcgConfigBuffer::ConfigBuffer object that is used for the mapping. Using this constructor implies that the LcgConfigBuffer::ConfigBuffer object was instantiated externally, and it requires that it does not go out of scope.
Definition at line 24 of file SQLQueryTranslator.cpp. |
|
Translates the specified query (intended to be posed to the canonical schema) into some new queries that can be posed to the implementation specific schema (in order) to retrieve the same information. Several queries may be needed for cases where the output language does not support joins. In that case, queries refer to the results of the other by "n#", where "n" is the query number. It may throw a QueryTranslationException if there are problems parsing the specified predicate
Implements LcgInfo::QueryTranslator. Implemented in LcgInfo::SQLtoLDAPQueryTranslator. |
|
Makes the semantic translation of the specified query (intended to be posed to the canonical schema). It alters some parameter variables, so that the translateQuery() method can complete the query translation (adding the syntactic one, if applicable). It may throw a QueryTranslationException if there are problems parsing the specified predicate
Definition at line 31 of file SQLQueryTranslator.cpp. References LcgInfo::escapeLiterals, LcgInfo::extractTable, LcgInfo::int2str, LcgInfo::QueryTranslator::mTRowT, LcgInfo::nocaseCompare, LcgInfo::tokenizeStrWithIndices, and LcgInfo::unescapeLiterals. Referenced by LcgInfo::SQLtoSQLQueryTranslator::translateQuery, and LcgInfo::SQLtoLDAPQueryTranslator::translateQuery. |