|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.QueryGenerator
IQueryGenerator is the primary class in Query Generation It is responsible for travering the XAT and finding operators to evaluate
Field Summary | |
protected static boolean |
debug
the incremental statement to use |
static int |
FULL
full generation |
static int |
MINIMAL
minimal generation |
protected OperatorEvaluator |
opEval
instance of the OperatorEvaluation |
protected IncrementalQuery |
qStmt
the incremental statement to use |
protected XATTree |
queryTree
the XAT to generate a query from |
protected int |
queryType
the type of query to generate |
protected static BindingTable |
variableTable
binding BindingTable |
Constructor Summary | |
QueryGenerator(BindingTable varTable)
Start the generator. |
|
QueryGenerator(BindingTable varTable,
boolean deb)
Start the generator. |
Method Summary | |
protected void |
addSQLOperator(XATOperator root)
adds a new SQL operator as a child of root parameter |
void |
generateQuery(XATTree treeToGenerateSQL,
int heuristic,
int queryTypeIn)
find an operator, using post order breadth first search call operator evaluator, then if take the resulting SQLFragment and add it to the SQLIncrementalStatement if the operator was evaluated |
BindingTable |
getVariableTable()
Set the variable table |
void |
initialize(int heuristic,
int queryType)
|
protected boolean |
processOperator(XATOperator toProcess)
processOperator will call evaluateOperator on the param operator then take the QueryResult object that was returned and will add the sql fragment to the incremental SQL statement if the operator was evaluated the toProcess operator will then be deleted from the tree |
void |
setVariableTable(BindingTable newVariableTable)
Set the variable table |
protected void |
traverseTree(XATOperator root)
Iterates over a tree starting at the root parameter traverses to the right child, then left child, then decides whether to evalutate this operator Once an operator's children have been examined, the operator is then processed and the result is added to sqlsmt. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected XATTree queryTree
public static final int FULL
public static final int MINIMAL
protected static BindingTable variableTable
protected OperatorEvaluator opEval
protected IncrementalQuery qStmt
protected static boolean debug
protected int queryType
Constructor Detail |
public QueryGenerator(BindingTable varTable)
public QueryGenerator(BindingTable varTable, boolean deb)
Method Detail |
protected void addSQLOperator(XATOperator root)
root
- the parent of the SQLOperator that will be createdpublic void generateQuery(XATTree treeToGenerateSQL, int heuristic, int queryTypeIn) throws UnknownQueryType
treeToGenerateSQL
- XATTreeheuristic
- intqueryTypeIn
- the type of query to generatepublic BindingTable getVariableTable()
newVariableTable
- BindingTablepublic void initialize(int heuristic, int queryType) throws UnknownQueryType
protected boolean processOperator(XATOperator toProcess)
processOperator will call evaluateOperator on the param operator then take the QueryResult object that was returned and will add the sql fragment to the incremental SQL statement if the operator was evaluated the toProcess operator will then be deleted from the tree
public void setVariableTable(BindingTable newVariableTable)
newVariableTable
- BindingTableprotected void traverseTree(XATOperator root)
Iterates over a tree starting at the root parameter traverses to the right child, then left child, then decides whether to evalutate this operator Once an operator's children have been examined, the operator is then processed and the result is added to sqlsmt. An operator is deleted after it is processed If a Tagger or Aggregate operator is found, the incremental query is added to the tree in addSQLOperatorsqlStmt is reset in case there are other operators
root
- the root of the tree to traverse.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |