ajax.catalog
Class Transformation

java.lang.Object
  |
  +--ajax.catalog.Transformation
All Implemented Interfaces:
CatalogObject
Direct Known Subclasses:
Clustering, EmbeddedQuery, Mapping, Matching, Merging, UnionView, View

public abstract class Transformation
extends java.lang.Object
implements CatalogObject


Field Summary
static int CLUST
           
static java.lang.String DBTransferStr
           
static java.lang.String dirExec
          Directories
static java.lang.String dirFiles
           
static java.lang.String dirFunctions
           
protected  java.util.List embeddedOutput
           
static java.lang.String endEvaluateHeader
           
static java.lang.String evaluateHeader
           
static java.lang.String evaluateTail
           
protected  Output exceptionOutput
           
static int FROM_FILE
           
static int FROM_TABLE
           
protected  int generatedCodeType
           
static java.lang.String ifTail
           
static java.lang.String importIOException
           
static java.lang.String importList
           
static java.lang.String importRunnableTransf
           
static java.lang.String importSqlException
           
static java.lang.String importSqlResultSet
          Generated code
static java.lang.String importWrapperException
           
static java.lang.String importWrapperManager
           
protected  int inputType
           
static int JAVA_CODE
           
static int MAPP
           
static int MATCH
           
static int MERG
           
static java.lang.String newLine
           
protected  java.util.List outerOutput
           
protected  int outputType
           
static int SQL_CODE
           
static java.lang.String tail
           
static int TO_FILE
          Constants that define the behaviour of the transformation
static int TO_TABLE
           
 int transfType
          Variables that define the transformation behaviour
static int VIEW
           
static java.lang.String wrapperInitialization
           
 
Constructor Summary
Transformation()
           
 
Method Summary
protected  Expression addAsList(java.util.List asList, java.lang.String asName, java.lang.String concatName, TransfInput in, Type type, boolean hidden, boolean input, java.lang.String originTable, java.lang.String originAttribute)
          Adds elements to the As list that will constitute the new Select clause
 void addEmbeddedQuery(EmbeddedQuery query)
          Adds an embeddedQuery to this transformation.
protected  void closeFile(java.io.BufferedWriter outStream)
          Closes a file That was used for writing the Java code that executes the transformation
protected  void closeOutputFiles(java.io.BufferedWriter outStream, Table[] matTable)
          Generates the code for closing the files that contain the output of transformations
 void closeOutputJdbc(java.io.BufferedWriter outStream, Table[] matTable)
          Generates the code for closing the jdbc statement used to write results in the database
protected  void createOutputFiles(java.io.BufferedWriter outStream, Table[] matTable)
          Generates the code that creates the files for writing the output of transformations MISSING TO CHECK CONSTRAINTS
protected  void createOutputTables(java.io.BufferedWriter outStream, Table[] matTable)
          Generates the code for creating the output of the transformation as table(s)
protected  void declareTransfer(java.io.BufferedWriter outStream)
          Generates the code that declares a Database transfer
protected  void doOuterJoinInSQL(java.io.BufferedWriter outStream, TransfInput outer)
          writes the query that handle the outer join associated to the specified TranfsInput object.
protected  void dump(java.io.BufferedWriter outStream, DatabaseTransfer dbTransfer, Table[] matTable)
          Generates the code that permits to dump the contents of a table into a file
protected  void dumpQuery(java.io.BufferedWriter outStream, DatabaseTransfer dbTransfer, java.lang.String query, java.lang.String tableName)
          Generates the code that permits to dump the result of a query into a file generates the code that will call sqlplus
protected  java.lang.String exceptionsToJava(java.io.Writer outStream)
          Writes the tuples that have thrown exceptions into the corresponding exception data flow
protected  java.lang.String fromToSQL()
          Converts the FROM clause into SQL
 java.util.LinkedList getAllOutputNames()
          Gets the ouputs names of the transformation It returns the names of the all outputs of the transformation, including the exception table name.
 java.util.Iterator getExceptionsLet()
          Gets the exceptions thrown explicitly in the LET clause of the transformation Contains a list of exceptions NOT USED FOR THE MOMENT
protected  Table[] getExceptionTable()
          Builds the schema of the exception table associated to this transformation.
 java.util.Iterator getFields(java.lang.String name)
          Get all the selected attributes for the named output
 FieldType getFieldType(java.lang.String fieldName, java.lang.String name)
          Given a field name, looks for the required field and returns its type.
 java.util.List getFrom()
          Gets the FROM clause of the transformation Contains the list of input data flows of the transformation
 int getIndex(java.lang.String name)
          Returns the index of a certain output in the this.output list
 int getIndexAttribute(java.lang.String outputName, java.lang.String attribute)
          Returns the index of an attribute for a given output Indexes start at 1
 java.util.LinkedList getInputNames()
          Gets the input names of the transformation including the inputs of the embedded selects Contains a list of input names It returns the names of the all inputs of the transformation,
 Table getInputTable(java.lang.String tableName)
          Gets the Table object having the given name, if it is an input table of this transformation
 java.util.List getKey(java.lang.String name)
          Returns the list of key attributes of the named output
protected  java.util.LinkedList getKeyAs(java.util.List key, ProjectionTerm select)
          Returns the key in the form of a list of As elements
 java.util.LinkedList getLet()
          getLet() Gets the LET clause of the transformation Contains a list of internal variables and expressions
protected  Table[] getMatTable()
          Builds the schema of the several explicit defined outputs of this trasformation.
 java.lang.String getName()
          Gets the name of the transformation
 java.util.LinkedList getOutput()
          Gets the OUTPUT of the transformation Contains a list of output clauses It returns only the explicit outputs.
 Output getOutput(java.lang.String outputName)
          Returns the Output object of this transforamtion whose name is equal to outputName.
 Output getOutputException()
           
 java.util.LinkedList getOutputNames()
          Gets the ouput names of the transformation Contains a list of output names It returns the names of the all outputs of the transformation, including the ones from embedded queries, from outer joins, except the exception table name
 int getOutputSize()
          Gets the ouput size of the transformation
 Table getOutputTable(java.lang.String tableName)
          Gets the Table object having the given name, if it is an output table of this transformation
protected  Table[] getTable(java.util.Collection outputs)
          Builds the schema of the implicit output that are associated to the the Output elements contained in the Collection.
 int getTransfType()
          Get the type of the transformation: mapping, matching, clustering or merging
 Expression getWhere()
          Gets the WHERE clause of the transformation Contains a list of conditions on the input and internal variables
 boolean hasNullConstraint(java.lang.String attribute)
          Checks if an output attribute has a null constraint
 void init(java.lang.String name, java.util.LinkedList output, java.util.List from, Expression algo, java.util.LinkedList let, Expression where)
          It will be called by Mapping and View transformations
protected  java.io.BufferedWriter initialize()
          Generates code for the header of the Java class that implements this transformation
 boolean isClustering()
          Checks if it's a clustering
 boolean isFromTable()
          Checks if the transformation reads the input from a file
 boolean isLetOptimizableDE()
          isLetOptimizableDE() Checks if the LET clause allows the match to be optimized by getting rid of the exact duplicates before executing the approximate match If it is optimizable, returns a list of T_REFERENCE expressions with the names of the columns used for the optimization
 boolean isLetToSQL()
          isLetToSQL() Checks if the LET clause: - contains an IF statement or a CORRELATED query - if it is a variable declaration and the type returned by the expression assigned is a ComposedType
 boolean isMapping()
          Checks if it's a mapping
 boolean isMatching()
          Checks if it's a matching
 boolean isMerging()
          Checks if it's a merging
 boolean isToSQL()
          Checks if the execution mode is toSQL
 boolean isToTable()
          Checks if the transformation writes its result to a table.
 boolean isTransformation()
          Returns true if the catalog object is a transformation and false if it is a table
 boolean isView()
          Checks if it's a view
 java.lang.String KeyExceptionToJava(Output output)
          Generates code for inserting values into the transformation exception output
protected  java.lang.String letToJava(java.lang.String spaces, boolean varDecl)
          Converts the Let clause into Java
protected  void load(java.io.BufferedWriter outStream, DatabaseTransfer dbTransfer)
          Generates the code that permits to load a file into a table
static void main(java.lang.String[] args)
           
protected  java.io.BufferedWriter openFile(java.lang.String fileName)
          Opens a file for writing Used for writing the Java code that executes the transformation
 java.util.Iterator outerOutputIter()
          Returns an iterator over the collection of Output objects (if any) related to the existing outer joins specified in the transformation.
protected  void selectToJava(java.io.Writer outStream, Table[] matTable, java.lang.String where, java.lang.String spaces1)
          Converts the Select clause into Java (JDBC call to insert the result of the Java processing)
protected  java.lang.String selectToSQL(Output output)
          Converts the SELECT clause into SQL
protected  void selectToSQLToTable(java.io.BufferedWriter outStream, Table[] matTable)
          Writes into the file the statement that executes the SQL statement
protected  void setExceptionOutput()
          Defines the output associated to the exception table. the key of each input is placed in the schema of this exception table plus an aditional field which contains the exception message.
 void setFromFile()
          Sets the transformation to read the input from a file
 void setFromTable()
          Sets the transformation to read the input from a file
 void setName(java.lang.String name)
          Assigns a name to the transformation
protected  void setOuterOutput()
          Defines the outputs associated to outer joins.
 void setToFile()
          Sets the transformation to write the output into a file
 void setToJava()
          Sets the execution mode to Java
 void setToSQL()
          Sets the execution mode to SQL
 void setToTable()
          Sets the transformation to write the output into a table
 void setWeaveOutputsSchemas(java.io.BufferedWriter bfw)
          Generates and writes the specification schemas, needed by Weave to implement the Explainer, for all the output tables of this transformation.
 void setWeaveRunTimePolicies(java.io.BufferedWriter bfw, Catalog catalog)
          Generates and writes the specification runtime policy, needed by Weave to implement the Explainer, associated to this transformation.
 java.lang.String toHtml()
          Converts the transformation into an html read-able object.
 void toJava()
          Generates a Java class that issues SQL calls, through JDBC, to get the data from the database and store the results back.
protected  void toJavaBody(java.io.Writer outStream, Table[] matTable)
          Generates code for executing the body of the transformation REDUCE THE SIZE OF THIS METHOD!
protected  void toJavaFromInput(java.io.Writer outStream)
          Generates code for reading the input of the transformation from a table
 java.lang.String toJavaQuery(Output output)
          Generates code for inserting values in the transformation output
 void toSQL()
          Generates a Java class that issues only SQL calls, through JDBC, for implementing the transformation
 java.lang.String toString()
          Converts the transformation into a human read-able object.
protected  java.lang.String toTableQuery(Output output, boolean toFile)
          Converts the transformation into an SQL statement.
 void toXML(java.lang.String XMLfileName)
          Converts the transformation into an XML document
 void updateAuxiliaryFunctions()
          Updates the LibCatalog with the auxiliary functions: generateClusterId() NOT SURE IF THIS METHOD IS NEEDED LIKE IT IS
protected  java.lang.String whereToJava(java.lang.String spaces)
          Converts the Where clause into Java
protected  java.lang.String whereToSQL()
          Converts the Where clause into SQL
protected  java.lang.String writeCollection(java.util.Iterator iter, java.lang.String separator)
          Write a collection of objects as a single line of strings separated by a specified separator.
protected  java.lang.String writeHtmlCollection(java.util.Iterator iter, java.lang.String separator)
          Write a collection of objects as a single line of strings separated by a specified separator.
protected  void writeTailClass(java.io.BufferedWriter outStream)
          Generates the code to close the class that implements the transformation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dirExec

public static final java.lang.String dirExec
Directories

dirFiles

public static final java.lang.String dirFiles

dirFunctions

public static final java.lang.String dirFunctions

importSqlResultSet

public static final java.lang.String importSqlResultSet
Generated code

importSqlException

public static final java.lang.String importSqlException

importIOException

public static final java.lang.String importIOException

importRunnableTransf

public static final java.lang.String importRunnableTransf

importWrapperManager

public static final java.lang.String importWrapperManager

importWrapperException

public static final java.lang.String importWrapperException

wrapperInitialization

public static final java.lang.String wrapperInitialization

importList

public static final java.lang.String importList

evaluateHeader

public static final java.lang.String evaluateHeader

endEvaluateHeader

public static final java.lang.String endEvaluateHeader

DBTransferStr

public static final java.lang.String DBTransferStr

tail

public static final java.lang.String tail

evaluateTail

public static final java.lang.String evaluateTail

ifTail

public static final java.lang.String ifTail

newLine

public static final java.lang.String newLine

TO_FILE

public static final int TO_FILE
Constants that define the behaviour of the transformation

TO_TABLE

public static final int TO_TABLE

JAVA_CODE

public static final int JAVA_CODE

SQL_CODE

public static final int SQL_CODE

FROM_FILE

public static final int FROM_FILE

FROM_TABLE

public static final int FROM_TABLE

MAPP

public static final int MAPP

MATCH

public static final int MATCH

CLUST

public static final int CLUST

MERG

public static final int MERG

VIEW

public static final int VIEW

transfType

public int transfType
Variables that define the transformation behaviour

outputType

protected int outputType

generatedCodeType

protected int generatedCodeType

inputType

protected int inputType

outerOutput

protected java.util.List outerOutput

embeddedOutput

protected java.util.List embeddedOutput

exceptionOutput

protected Output exceptionOutput
Constructor Detail

Transformation

public Transformation()
Method Detail

init

public void init(java.lang.String name,
                 java.util.LinkedList output,
                 java.util.List from,
                 Expression algo,
                 java.util.LinkedList let,
                 Expression where)
          throws CatalogException,
                 AjaxTypeException
It will be called by Mapping and View transformations

setOuterOutput

protected void setOuterOutput()
                       throws CatalogException,
                              AjaxTypeException
Defines the outputs associated to outer joins.

setExceptionOutput

protected void setExceptionOutput()
                           throws CatalogException,
                                  AjaxTypeException
Defines the output associated to the exception table. the key of each input is placed in the schema of this exception table plus an aditional field which contains the exception message. If the input tables does not contain a key, the output exception table is not created.

addAsList

protected Expression addAsList(java.util.List asList,
                               java.lang.String asName,
                               java.lang.String concatName,
                               TransfInput in,
                               Type type,
                               boolean hidden,
                               boolean input,
                               java.lang.String originTable,
                               java.lang.String originAttribute)
                        throws AjaxTypeException
Adds elements to the As list that will constitute the new Select clause

addEmbeddedQuery

public final void addEmbeddedQuery(EmbeddedQuery query)
Adds an embeddedQuery to this transformation.

isTransformation

public boolean isTransformation()
Returns true if the catalog object is a transformation and false if it is a table
Specified by:
isTransformation in interface CatalogObject

getTransfType

public int getTransfType()
Get the type of the transformation: mapping, matching, clustering or merging

isMerging

public boolean isMerging()
Checks if it's a merging

isView

public boolean isView()
Checks if it's a view

isClustering

public boolean isClustering()
Checks if it's a clustering

isMapping

public boolean isMapping()
Checks if it's a mapping

isMatching

public boolean isMatching()
Checks if it's a matching

setToSQL

public void setToSQL()
Sets the execution mode to SQL

setToJava

public void setToJava()
Sets the execution mode to Java

isToSQL

public boolean isToSQL()
Checks if the execution mode is toSQL

setToTable

public void setToTable()
Sets the transformation to write the output into a table

setToFile

public void setToFile()
Sets the transformation to write the output into a file

isToTable

public boolean isToTable()
Checks if the transformation writes its result to a table.

setFromFile

public void setFromFile()
Sets the transformation to read the input from a file

setFromTable

public void setFromTable()
Sets the transformation to read the input from a file

isFromTable

public boolean isFromTable()
Checks if the transformation reads the input from a file

setName

public void setName(java.lang.String name)
Assigns a name to the transformation

getName

public java.lang.String getName()
Gets the name of the transformation
Specified by:
getName in interface CatalogObject

getFrom

public java.util.List getFrom()
Gets the FROM clause of the transformation Contains the list of input data flows of the transformation

getLet

public java.util.LinkedList getLet()
getLet() Gets the LET clause of the transformation Contains a list of internal variables and expressions

getExceptionsLet

public java.util.Iterator getExceptionsLet()
Gets the exceptions thrown explicitly in the LET clause of the transformation Contains a list of exceptions NOT USED FOR THE MOMENT

getWhere

public Expression getWhere()
Gets the WHERE clause of the transformation Contains a list of conditions on the input and internal variables

getOutput

public java.util.LinkedList getOutput()
Gets the OUTPUT of the transformation Contains a list of output clauses It returns only the explicit outputs.

getInputNames

public java.util.LinkedList getInputNames()
Gets the input names of the transformation including the inputs of the embedded selects Contains a list of input names It returns the names of the all inputs of the transformation,

getInputTable

public Table getInputTable(java.lang.String tableName)
Gets the Table object having the given name, if it is an input table of this transformation
Parameters:
tableName - a string representing the name of the table
Returns:
the associated Table object

getOutputNames

public java.util.LinkedList getOutputNames()
Gets the ouput names of the transformation Contains a list of output names It returns the names of the all outputs of the transformation, including the ones from embedded queries, from outer joins, except the exception table name

getAllOutputNames

public java.util.LinkedList getAllOutputNames()
Gets the ouputs names of the transformation It returns the names of the all outputs of the transformation, including the exception table name.
Returns:
the output data flows name list

getOutput

public Output getOutput(java.lang.String outputName)
                 throws CatalogException
Returns the Output object of this transforamtion whose name is equal to outputName. This Output object can be explicit (the result name of the transformation ot the several INTO in the case of a MAPPING transformation) or it can be an implicit Output object created due to the existence of an outer join in the transformation. If it is not found an output with the same name, a CatalogException is thrown.

getOutputSize

public int getOutputSize()
Gets the ouput size of the transformation

outerOutputIter

public final java.util.Iterator outerOutputIter()
Returns an iterator over the collection of Output objects (if any) related to the existing outer joins specified in the transformation. Returns null if there is not any specified outer join.

hasNullConstraint

public boolean hasNullConstraint(java.lang.String attribute)
Checks if an output attribute has a null constraint

getIndex

public int getIndex(java.lang.String name)
             throws ajax.catalog.TransfException
Returns the index of a certain output in the this.output list

getIndexAttribute

public int getIndexAttribute(java.lang.String outputName,
                             java.lang.String attribute)
                      throws CatalogException
Returns the index of an attribute for a given output Indexes start at 1
Specified by:
getIndexAttribute in interface CatalogObject

getKey

public java.util.List getKey(java.lang.String name)
                      throws CatalogException
Returns the list of key attributes of the named output
Specified by:
getKey in interface CatalogObject

getFields

public java.util.Iterator getFields(java.lang.String name)
                             throws CatalogException
Get all the selected attributes for the named output
Specified by:
getFields in interface CatalogObject

getFieldType

public FieldType getFieldType(java.lang.String fieldName,
                              java.lang.String name)
                       throws CatalogException
Given a field name, looks for the required field and returns its type.
Specified by:
getFieldType in interface CatalogObject

getKeyAs

protected java.util.LinkedList getKeyAs(java.util.List key,
                                        ProjectionTerm select)
                                 throws AjaxTypeException
Returns the key in the form of a list of As elements

updateAuxiliaryFunctions

public void updateAuxiliaryFunctions()
                              throws CatalogException
Updates the LibCatalog with the auxiliary functions: generateClusterId() NOT SURE IF THIS METHOD IS NEEDED LIKE IT IS

openFile

protected java.io.BufferedWriter openFile(java.lang.String fileName)
                                   throws java.io.IOException
Opens a file for writing Used for writing the Java code that executes the transformation

closeFile

protected void closeFile(java.io.BufferedWriter outStream)
                  throws java.io.IOException
Closes a file That was used for writing the Java code that executes the transformation

getMatTable

protected Table[] getMatTable()
                       throws ajax.catalog.TransfException
Builds the schema of the several explicit defined outputs of this trasformation. Returns a Table object for each output.

getTable

protected Table[] getTable(java.util.Collection outputs)
Builds the schema of the implicit output that are associated to the the Output elements contained in the Collection. For each Output element returns a Table element which describes the schema defined by the Output element.
Parameters:
outputs - is a collection with several Output elements. The collection can be null or empty
Returns:
an array with the Table elements corresponding to the Output elements. It may return null if none Output element.

getExceptionTable

protected Table[] getExceptionTable()
Builds the schema of the exception table associated to this transformation. Returns a Table array containing the table that defines the exception table schema.

initialize

protected java.io.BufferedWriter initialize()
                                     throws java.io.IOException
Generates code for the header of the Java class that implements this transformation

writeTailClass

protected void writeTailClass(java.io.BufferedWriter outStream)
                       throws java.io.IOException
Generates the code to close the class that implements the transformation

createOutputTables

protected void createOutputTables(java.io.BufferedWriter outStream,
                                  Table[] matTable)
                           throws CatalogException,
                                  java.io.IOException,
                                  AjaxTypeException
Generates the code for creating the output of the transformation as table(s)

createOutputFiles

protected void createOutputFiles(java.io.BufferedWriter outStream,
                                 Table[] matTable)
                          throws ajax.catalog.TransfException,
                                 java.io.IOException,
                                 AjaxTypeException
Generates the code that creates the files for writing the output of transformations MISSING TO CHECK CONSTRAINTS

closeOutputFiles

protected void closeOutputFiles(java.io.BufferedWriter outStream,
                                Table[] matTable)
                         throws java.io.IOException
Generates the code for closing the files that contain the output of transformations

closeOutputJdbc

public void closeOutputJdbc(java.io.BufferedWriter outStream,
                            Table[] matTable)
                     throws java.io.IOException
Generates the code for closing the jdbc statement used to write results in the database

toSQL

public void toSQL()
           throws CatalogException,
                  java.io.IOException,
                  AjaxTypeException
Generates a Java class that issues only SQL calls, through JDBC, for implementing the transformation

doOuterJoinInSQL

protected void doOuterJoinInSQL(java.io.BufferedWriter outStream,
                                TransfInput outer)
                         throws java.io.IOException,
                                CatalogException
writes the query that handle the outer join associated to the specified TranfsInput object. NOTE: for the moment we are supposing that the key fields names in the transformation specified by "outer" have the same names in the schema of this transformation. CHANGE this method to take into account the existence of outerOutput.

isLetToSQL

public boolean isLetToSQL()
isLetToSQL() Checks if the LET clause: - contains an IF statement or a CORRELATED query - if it is a variable declaration and the type returned by the expression assigned is a ComposedType

isLetOptimizableDE

public boolean isLetOptimizableDE()
isLetOptimizableDE() Checks if the LET clause allows the match to be optimized by getting rid of the exact duplicates before executing the approximate match If it is optimizable, returns a list of T_REFERENCE expressions with the names of the columns used for the optimization

selectToSQLToTable

protected void selectToSQLToTable(java.io.BufferedWriter outStream,
                                  Table[] matTable)
                           throws java.io.IOException
Writes into the file the statement that executes the SQL statement

toTableQuery

protected java.lang.String toTableQuery(Output output,
                                        boolean toFile)
Converts the transformation into an SQL statement.

selectToSQL

protected java.lang.String selectToSQL(Output output)
Converts the SELECT clause into SQL

fromToSQL

protected java.lang.String fromToSQL()
Converts the FROM clause into SQL

whereToSQL

protected java.lang.String whereToSQL()
Converts the Where clause into SQL

load

protected void load(java.io.BufferedWriter outStream,
                    DatabaseTransfer dbTransfer)
             throws CatalogException,
                    java.io.IOException,
                    AjaxTypeException
Generates the code that permits to load a file into a table

dump

protected void dump(java.io.BufferedWriter outStream,
                    DatabaseTransfer dbTransfer,
                    Table[] matTable)
             throws java.io.IOException
Generates the code that permits to dump the contents of a table into a file

dumpQuery

protected void dumpQuery(java.io.BufferedWriter outStream,
                         DatabaseTransfer dbTransfer,
                         java.lang.String query,
                         java.lang.String tableName)
                  throws java.io.IOException
Generates the code that permits to dump the result of a query into a file generates the code that will call sqlplus

declareTransfer

protected void declareTransfer(java.io.BufferedWriter outStream)
                        throws java.io.IOException
Generates the code that declares a Database transfer

toJava

public void toJava()
            throws CatalogException,
                   java.io.IOException,
                   ExpressionException,
                   AjaxTypeException
Generates a Java class that issues SQL calls, through JDBC, to get the data from the database and store the results back. The execution of the transformation is done in Java

toJavaFromInput

protected void toJavaFromInput(java.io.Writer outStream)
                        throws CatalogException,
                               java.io.IOException,
                               ExpressionException,
                               AjaxTypeException
Generates code for reading the input of the transformation from a table

toJavaBody

protected void toJavaBody(java.io.Writer outStream,
                          Table[] matTable)
                   throws CatalogException,
                          java.io.IOException,
                          ExpressionException,
                          AjaxTypeException
Generates code for executing the body of the transformation REDUCE THE SIZE OF THIS METHOD!

letToJava

protected java.lang.String letToJava(java.lang.String spaces,
                                     boolean varDecl)
                              throws CatalogException,
                                     ExpressionException,
                                     AjaxTypeException
Converts the Let clause into Java

whereToJava

protected java.lang.String whereToJava(java.lang.String spaces)
                                throws CatalogException,
                                       ExpressionException,
                                       AjaxTypeException
Converts the Where clause into Java

selectToJava

protected void selectToJava(java.io.Writer outStream,
                            Table[] matTable,
                            java.lang.String where,
                            java.lang.String spaces1)
                     throws CatalogException,
                            java.io.IOException,
                            ExpressionException,
                            AjaxTypeException
Converts the Select clause into Java (JDBC call to insert the result of the Java processing)

exceptionsToJava

protected java.lang.String exceptionsToJava(java.io.Writer outStream)
                                     throws CatalogException,
                                            java.io.IOException,
                                            ExpressionException,
                                            AjaxTypeException
Writes the tuples that have thrown exceptions into the corresponding exception data flow

toJavaQuery

public java.lang.String toJavaQuery(Output output)
                             throws CatalogException,
                                    ExpressionException,
                                    AjaxTypeException
Generates code for inserting values in the transformation output

KeyExceptionToJava

public java.lang.String KeyExceptionToJava(Output output)
                                    throws CatalogException,
                                           ExpressionException,
                                           AjaxTypeException
Generates code for inserting values into the transformation exception output

toXML

public void toXML(java.lang.String XMLfileName)
Converts the transformation into an XML document
Specified by:
toXML in interface CatalogObject

toString

public java.lang.String toString()
Converts the transformation into a human read-able object.
Overrides:
toString in class java.lang.Object

toHtml

public java.lang.String toHtml()
Converts the transformation into an html read-able object.

writeCollection

protected java.lang.String writeCollection(java.util.Iterator iter,
                                           java.lang.String separator)
Write a collection of objects as a single line of strings separated by a specified separator.

writeHtmlCollection

protected java.lang.String writeHtmlCollection(java.util.Iterator iter,
                                               java.lang.String separator)
Write a collection of objects as a single line of strings separated by a specified separator.

getOutputException

public Output getOutputException()

getOutputTable

public Table getOutputTable(java.lang.String tableName)
Gets the Table object having the given name, if it is an output table of this transformation
Parameters:
tableName - a string representing the name of the table
Returns:
the associated Table object

setWeaveOutputsSchemas

public void setWeaveOutputsSchemas(java.io.BufferedWriter bfw)
                            throws CatalogException,
                                   java.io.IOException
Generates and writes the specification schemas, needed by Weave to implement the Explainer, for all the output tables of this transformation. This code will be part of the Weave's schemas file .sch
Parameters:
bfw - a BufferedWriter object where to write the generated sch code

setWeaveRunTimePolicies

public void setWeaveRunTimePolicies(java.io.BufferedWriter bfw,
                                    Catalog catalog)
                             throws CatalogException,
                                    java.io.IOException
Generates and writes the specification runtime policy, needed by Weave to implement the Explainer, associated to this transformation. This code will be part of the Weave's runtime policy file .rtp
Parameters:
bfw - a BufferedWriter object where to write the generated rtp code
catalog - this is the catalog object which stores all the base objects like transormations and tables

main

public static void main(java.lang.String[] args)