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

java.lang.Object
  |
  +--edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.IncrementalQuery
        |
        +--edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.IncrementalSQL

public class IncrementalSQL
extends IncrementalQuery

IncrementalSQL is stores an SQL query that is incrementally built.


Field Summary
protected  java.util.Vector distinct
          distinct clause
protected  java.util.Vector from
          from clause
protected  java.util.Vector function
          If there is an aggregate function applied to some column
protected  java.util.Vector groupBy
          groupBy clause
static int MULTISTEPORDER
           
protected  java.util.Vector orderBy
          orderBy clause
protected  java.lang.String positionFrag
          position fragment
protected  java.util.Hashtable renameHash
          Lists all Table.Column values and their equivalent Rename Values
protected  java.util.Vector select
          select clause
static int SINGLESTEPORDER
           
protected  java.util.Hashtable tableColHash
          Lists all Rename values and their equivalent Table.Column Values
protected  java.util.Vector where
          where clause
 
Fields inherited from class edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.IncrementalQuery
variableTable
 
Constructor Summary
IncrementalSQL(BindingTable varTable)
           
 
Method Summary
 void addClause(QueryFragment fragment)
           addClause accepts an QueryFragment.
 java.lang.String createOrder(java.lang.String params, int type)
          Insert the method's description here.
 java.lang.String getStatement()
          getSQLStatement returns 1 SQL statement that is the combination of the various clause properties
 void initialize()
          ReInitialize's this IncrementalStatement
 java.lang.String stripColumns(java.lang.String input)
          This method will strip the original column element from the Select leaving the renamed value string so that it can be used appropriately the outmost nest: "s100004".EDGES AS "$col220001" to "$col220001" The input will resemble "SELECT [DISTINCT]? "blue"."blee" as "blah" The output will resemble "SELECT [DISTINCT]? "blah"" Creation date: (4/8/2003 2:14:35 PM)
 java.lang.String stripRename(java.lang.String input)
          This method will strip the renaming elements from the Select string so that it can be used appropriately in nested queries: "s100004".EDGES AS "$col220001" to "s100004".EDGES The input will resemble "SELECT [DISTINCT]? "blue"."blee" as "blah" The output will resemble "SELECT [DISTINCT]? "blue"."blee"" Creation date: (4/7/2003 2:14:35 PM)
 java.lang.String toColName(java.lang.String input)
          This method will translate the rename element to the Column Name element "$col220001" to "s100004".EDGES The input will resemble "WHERE "blah" = ..." The output will resemble "WHERE "blee.bloo" = ..." Creation date: (4/8/2003 2:14:35 PM)
 java.lang.String toString()
          Insert the method's description here.
 
Methods inherited from class edu.wpi.cs.dsrg.xmldb.xat.component.sqlgeneration.IncrementalQuery
getVariableTable, setVariableTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

select

protected java.util.Vector select
select clause

positionFrag

protected java.lang.String positionFrag
position fragment

from

protected java.util.Vector from
from clause

where

protected java.util.Vector where
where clause

groupBy

protected java.util.Vector groupBy
groupBy clause

orderBy

protected java.util.Vector orderBy
orderBy clause

distinct

protected java.util.Vector distinct
distinct clause

function

protected java.util.Vector function
If there is an aggregate function applied to some column

MULTISTEPORDER

public static int MULTISTEPORDER

SINGLESTEPORDER

public static int SINGLESTEPORDER

renameHash

protected java.util.Hashtable renameHash
Lists all Table.Column values and their equivalent Rename Values

tableColHash

protected java.util.Hashtable tableColHash
Lists all Rename values and their equivalent Table.Column Values
Constructor Detail

IncrementalSQL

public IncrementalSQL(BindingTable varTable)
Method Detail

addClause

public void addClause(QueryFragment fragment)
Description copied from class: IncrementalQuery
  addClause accepts an QueryFragment.  It takes the
  clauseText from the fragment and appends it to the
  appropriate clause vector
 
Overrides:
addClause in class IncrementalQuery
Tags copied from class: IncrementalQuery
Parameters:
fragment - the QueryFragment to add to the SQL statement

createOrder

public java.lang.String createOrder(java.lang.String params,
                                    int type)
Insert the method's description here. Creation date: (4/8/2003 1:34:01 PM)
Parameters:
params - java.lang.String
type - int
Returns:
java.lang.String

getStatement

public java.lang.String getStatement()
                              throws SQLNoStatementExists
getSQLStatement returns 1 SQL statement that is the combination of the various clause properties
Overrides:
getStatement in class IncrementalQuery
Returns:
String

initialize

public void initialize()
ReInitialize's this IncrementalStatement
Overrides:
initialize in class IncrementalQuery

stripColumns

public java.lang.String stripColumns(java.lang.String input)
This method will strip the original column element from the Select leaving the renamed value string so that it can be used appropriately the outmost nest: "s100004".EDGES AS "$col220001" to "$col220001" The input will resemble "SELECT [DISTINCT]? "blue"."blee" as "blah" The output will resemble "SELECT [DISTINCT]? "blah"" Creation date: (4/8/2003 2:14:35 PM)
Parameters:
input - java.lang.String
Returns:
java.lang.String

stripRename

public java.lang.String stripRename(java.lang.String input)
This method will strip the renaming elements from the Select string so that it can be used appropriately in nested queries: "s100004".EDGES AS "$col220001" to "s100004".EDGES The input will resemble "SELECT [DISTINCT]? "blue"."blee" as "blah" The output will resemble "SELECT [DISTINCT]? "blue"."blee"" Creation date: (4/7/2003 2:14:35 PM)
Parameters:
input - java.lang.String
Returns:
java.lang.String

toColName

public java.lang.String toColName(java.lang.String input)
This method will translate the rename element to the Column Name element "$col220001" to "s100004".EDGES The input will resemble "WHERE "blah" = ..." The output will resemble "WHERE "blee.bloo" = ..." Creation date: (4/8/2003 2:14:35 PM)
Parameters:
input - java.lang.String
Returns:
java.lang.String

toString

public java.lang.String toString()
Insert the method's description here. Creation date: (9/17/2002 3:40:51 PM)
Overrides:
toString in class java.lang.Object
Returns:
java.lang.String