edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration
Class SQLOperatorEvaluator

java.lang.Object
  |
  +--edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor
        |
        +--edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.OperatorEvaluator
              |
              +--edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.SQLOperatorEvaluator

public class SQLOperatorEvaluator
extends OperatorEvaluator

SQLOperator Evaluator is used to help create SQL queries


Fields inherited from class edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.OperatorEvaluator
heuristicType, sourceVisited, variableTable
 
Constructor Summary
SQLOperatorEvaluator(BindingTable varTable)
          Call the super's constuctor
SQLOperatorEvaluator(int heuristic, BindingTable varTable)
          Call the super constructor
 
Method Summary
 java.lang.Object visit(CartesianProductImp param)
          Evaluates a CartesianProduct Operator and determines the SQL equivalent of the destination ReWriting will take of this so it wont happen
 java.lang.Object visit(DistinctImp param)
           Evaluates a Distinct Operator and determines the SQL equivalent of the destination The result contains a fragment with the Distinct's output name in it
 java.lang.Object visit(FunctionImp param)
           Evaluates a Function Operator and determines the SQL equivalent The function name is the name parameter of the result The function parameters go into the parameters field of the result The function binding is the binding of the result
 java.lang.Object visit(GroupByImp param)
           Evaluates an GroupBy Operator and determines the SQL equivalent of the destination take all of the columns names in the orderBy and add them to the oderBy clause the result will look like GroupBy col1, col2, etc
 java.lang.Object visit(JoinImp param)
           Evaluates a Join Operator and determines the SQL equivalent of the destination This adds to the where clause, it will look like Where $a = '10'
 java.lang.Object visit(NameColumnImp param)
          Deprecated. NameColumn operators can now be pushed down so they will not occur in the tree to generate a query from
 java.lang.Object visit(Navigate param)
           Evaluates a Navigate Operator and determines the SQL equivalent of the destination If the Navigate contains a row in the destination, it goes to the FROM, otherwise it goes to the SELECT
 java.lang.Object visit(OrderByImp param)
           Evaluates an OrderBy Operator and determines the SQL equivalent of the destination take all of the columns names in the orderBy and add them to the oderBy clause the result will look like OrderBy col1, col2, etc
 java.lang.Object visit(ProjectImp param)
          Evaluates a Project Operator and determines the SQL equivalent of the destination This wont happen either
 java.lang.Object visit(SelectImp param)
           Evaluates a Select Operator and determines the SQL equivalent of the destination This adds to the where clause, it will look like Where $a = '10'
 java.lang.Object visit(SourceImp param)
           Evaluates a Source Operator and determines the SQL equivalent of the destination The Source doesnt have an SQL equivalent so it is just a blank fragment
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.OperatorEvaluator
combineSteps, createString, createString, dispatch, dispatch, evaluateOperator, getVariableTable, isSourceVisited, setHeuristicType, setSourceVisited, setVariableTable
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.common.visitorpattern.InheritableVisitor
getAncestors, getMethod, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLOperatorEvaluator

public SQLOperatorEvaluator(int heuristic,
                            BindingTable varTable)
Call the super constructor
Parameters:
heuristic - int
varTable - BindingTable

SQLOperatorEvaluator

public SQLOperatorEvaluator(BindingTable varTable)
Call the super's constuctor
Parameters:
varTable - java.util.Hashtable
Method Detail

visit

public java.lang.Object visit(FunctionImp param)
 Evaluates a Function Operator and determines the SQL equivalent 
 The function name is the name parameter of the result
 The function parameters go into the parameters field of the result
 The function binding is the binding of the result
 
Parameters:
param - Function
Returns:
java.lang.Object

visit

public java.lang.Object visit(NameColumnImp param)
Deprecated. NameColumn operators can now be pushed down so they will not occur in the tree to generate a query from

 Evaluates a NameColumn Operator and determines the SQL equivalent of the destination
 the old column name is return in the name parameter of the fragment, 
 the new name is the binding
 
Parameters:
param - NameColumnImp
Returns:
java.lang.Object

visit

public java.lang.Object visit(SourceImp param)
 Evaluates a Source Operator and determines the SQL equivalent of the destination
 The Source doesnt have an SQL equivalent so it is just a blank fragment
 
Parameters:
param - Source
Returns:
java.lang.Object

visit

public java.lang.Object visit(CartesianProductImp param)
Evaluates a CartesianProduct Operator and determines the SQL equivalent of the destination ReWriting will take of this so it wont happen
Parameters:
param - CartesianProductImp
Returns:
java.lang.Object

visit

public java.lang.Object visit(DistinctImp param)
 Evaluates a Distinct Operator and determines the SQL equivalent of the destination
 The result contains a fragment with the Distinct's output name in it
 
Parameters:
param - Distinct
Returns:
java.lang.Object

visit

public java.lang.Object visit(GroupByImp param)
Evaluates an GroupBy Operator and determines the SQL equivalent of the destination take all of the columns names in the orderBy and add them to the oderBy clause the result will look like GroupBy col1, col2, etc GroupBy returns multiple SQL fragments, 1 for the groupBy and 1 for each of the operators in its subTree Therefore, we first visit the subTree first
Parameters:
param - GroupBy
Returns:
java.lang.Object

visit

public java.lang.Object visit(JoinImp param)
 Evaluates a Join Operator and determines the SQL equivalent of the destination
 This adds to the where clause, it will look like Where $a = '10'
 
Same thing as select
Parameters:
param - Join
Returns:
java.lang.Object

visit

public java.lang.Object visit(OrderByImp param)
 Evaluates an OrderBy Operator and determines the SQL equivalent of the destination
 take all of the columns names in the orderBy and add them to the oderBy clause
 the result will look like OrderBy col1, col2, etc
 
Parameters:
param - OrderBy
Returns:
java.lang.Object

visit

public java.lang.Object visit(ProjectImp param)
Evaluates a Project Operator and determines the SQL equivalent of the destination This wont happen either
Parameters:
param - Project
Returns:
java.lang.Object

visit

public java.lang.Object visit(SelectImp param)
 Evaluates a Select Operator and determines the SQL equivalent of the destination
 This adds to the where clause, it will look like Where $a = '10'
 
Parameters:
param - Select
Returns:
java.lang.Object

visit

public java.lang.Object visit(Navigate param)
 Evaluates a Navigate Operator and determines the SQL equivalent of the destination
 If the Navigate contains a row in the destination, it goes to the FROM, otherwise
 it goes to the SELECT
 
Parameters:
param - Navigate
Returns:
java.lang.Object