00001
00002
00003
00004 #ifndef SQL_QUERY_TRANSLATOR_HH
00005 #define SQL_QUERY_TRANSLATOR_HH
00006
00007 #include "TableRowTranslator.h"
00008 #include "QueryTranslationException.h"
00009 #include "SQLPredicateTree.h"
00010 #include <set>
00011 #include "QueryTranslator.h"
00012
00013
00014 namespace LcgInfo{
00015
00016
00032 class SQLQueryTranslator: public QueryTranslator{
00033
00034 public:
00035
00042 SQLQueryTranslator();
00043
00051 SQLQueryTranslator(std::string const & pMapFile);
00052
00061 SQLQueryTranslator(LcgConfigBuffer::ConfigBuffer & pMap);
00062
00066 virtual ~SQLQueryTranslator();
00067
00080 virtual std::vector<std::string> translateQuery(std::string const & pQueryCanonical)=0;
00081
00095 void translateSemantic(std::string const & pQueryCanonical, SQLPredicateTree & pPred,
00096 std::vector<std::string> & pRowsToReturn,
00097 std::set<std::string> & pNewTableList);
00098
00099
00100 protected:
00101
00102
00103
00104
00105 static std::string const CHARS_TO_DIVIDE_SQL_WORDS;
00106
00107
00108
00109
00110 static std::string const CHARS_POSSIBLY_ESCAPED;
00111
00112 };
00113
00114
00115 }
00116 #endif