|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ajax.catalog.Transformation
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 |
public static final java.lang.String dirExec
public static final java.lang.String dirFiles
public static final java.lang.String dirFunctions
public static final java.lang.String importSqlResultSet
public static final java.lang.String importSqlException
public static final java.lang.String importIOException
public static final java.lang.String importRunnableTransf
public static final java.lang.String importWrapperManager
public static final java.lang.String importWrapperException
public static final java.lang.String wrapperInitialization
public static final java.lang.String importList
public static final java.lang.String evaluateHeader
public static final java.lang.String endEvaluateHeader
public static final java.lang.String DBTransferStr
public static final java.lang.String tail
public static final java.lang.String evaluateTail
public static final java.lang.String ifTail
public static final java.lang.String newLine
public static final int TO_FILE
public static final int TO_TABLE
public static final int JAVA_CODE
public static final int SQL_CODE
public static final int FROM_FILE
public static final int FROM_TABLE
public static final int MAPP
public static final int MATCH
public static final int CLUST
public static final int MERG
public static final int VIEW
public int transfType
protected int outputType
protected int generatedCodeType
protected int inputType
protected java.util.List outerOutput
protected java.util.List embeddedOutput
protected Output exceptionOutput
Constructor Detail |
public Transformation()
Method Detail |
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
protected void setOuterOutput() throws CatalogException, AjaxTypeException
protected void setExceptionOutput() throws CatalogException, AjaxTypeException
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
public final void addEmbeddedQuery(EmbeddedQuery query)
public boolean isTransformation()
isTransformation
in interface CatalogObject
public int getTransfType()
public boolean isMerging()
public boolean isView()
public boolean isClustering()
public boolean isMapping()
public boolean isMatching()
public void setToSQL()
public void setToJava()
public boolean isToSQL()
public void setToTable()
public void setToFile()
public boolean isToTable()
public void setFromFile()
public void setFromTable()
public boolean isFromTable()
public void setName(java.lang.String name)
public java.lang.String getName()
getName
in interface CatalogObject
public java.util.List getFrom()
public java.util.LinkedList getLet()
public java.util.Iterator getExceptionsLet()
public Expression getWhere()
public java.util.LinkedList getOutput()
public java.util.LinkedList getInputNames()
public Table getInputTable(java.lang.String tableName)
tableName
- a string representing the name of the tablepublic java.util.LinkedList getOutputNames()
public java.util.LinkedList getAllOutputNames()
public Output getOutput(java.lang.String outputName) throws CatalogException
public int getOutputSize()
public final java.util.Iterator outerOutputIter()
public boolean hasNullConstraint(java.lang.String attribute)
public int getIndex(java.lang.String name) throws ajax.catalog.TransfException
public int getIndexAttribute(java.lang.String outputName, java.lang.String attribute) throws CatalogException
getIndexAttribute
in interface CatalogObject
public java.util.List getKey(java.lang.String name) throws CatalogException
getKey
in interface CatalogObject
public java.util.Iterator getFields(java.lang.String name) throws CatalogException
getFields
in interface CatalogObject
public FieldType getFieldType(java.lang.String fieldName, java.lang.String name) throws CatalogException
getFieldType
in interface CatalogObject
protected java.util.LinkedList getKeyAs(java.util.List key, ProjectionTerm select) throws AjaxTypeException
public void updateAuxiliaryFunctions() throws CatalogException
protected java.io.BufferedWriter openFile(java.lang.String fileName) throws java.io.IOException
protected void closeFile(java.io.BufferedWriter outStream) throws java.io.IOException
protected Table[] getMatTable() throws ajax.catalog.TransfException
protected Table[] getTable(java.util.Collection outputs)
outputs
- is a collection with several Output elements. The collection
can be null or emptyprotected Table[] getExceptionTable()
protected java.io.BufferedWriter initialize() throws java.io.IOException
protected void writeTailClass(java.io.BufferedWriter outStream) throws java.io.IOException
protected void createOutputTables(java.io.BufferedWriter outStream, Table[] matTable) throws CatalogException, java.io.IOException, AjaxTypeException
protected void createOutputFiles(java.io.BufferedWriter outStream, Table[] matTable) throws ajax.catalog.TransfException, java.io.IOException, AjaxTypeException
protected void closeOutputFiles(java.io.BufferedWriter outStream, Table[] matTable) throws java.io.IOException
public void closeOutputJdbc(java.io.BufferedWriter outStream, Table[] matTable) throws java.io.IOException
public void toSQL() throws CatalogException, java.io.IOException, AjaxTypeException
protected void doOuterJoinInSQL(java.io.BufferedWriter outStream, TransfInput outer) throws java.io.IOException, CatalogException
public boolean isLetToSQL()
public boolean isLetOptimizableDE()
protected void selectToSQLToTable(java.io.BufferedWriter outStream, Table[] matTable) throws java.io.IOException
protected java.lang.String toTableQuery(Output output, boolean toFile)
protected java.lang.String selectToSQL(Output output)
protected java.lang.String fromToSQL()
protected java.lang.String whereToSQL()
protected void load(java.io.BufferedWriter outStream, DatabaseTransfer dbTransfer) throws CatalogException, java.io.IOException, AjaxTypeException
protected void dump(java.io.BufferedWriter outStream, DatabaseTransfer dbTransfer, Table[] matTable) throws java.io.IOException
protected void dumpQuery(java.io.BufferedWriter outStream, DatabaseTransfer dbTransfer, java.lang.String query, java.lang.String tableName) throws java.io.IOException
protected void declareTransfer(java.io.BufferedWriter outStream) throws java.io.IOException
public void toJava() throws CatalogException, java.io.IOException, ExpressionException, AjaxTypeException
protected void toJavaFromInput(java.io.Writer outStream) throws CatalogException, java.io.IOException, ExpressionException, AjaxTypeException
protected void toJavaBody(java.io.Writer outStream, Table[] matTable) throws CatalogException, java.io.IOException, ExpressionException, AjaxTypeException
protected java.lang.String letToJava(java.lang.String spaces, boolean varDecl) throws CatalogException, ExpressionException, AjaxTypeException
protected java.lang.String whereToJava(java.lang.String spaces) throws CatalogException, ExpressionException, AjaxTypeException
protected void selectToJava(java.io.Writer outStream, Table[] matTable, java.lang.String where, java.lang.String spaces1) throws CatalogException, java.io.IOException, ExpressionException, AjaxTypeException
protected java.lang.String exceptionsToJava(java.io.Writer outStream) throws CatalogException, java.io.IOException, ExpressionException, AjaxTypeException
public java.lang.String toJavaQuery(Output output) throws CatalogException, ExpressionException, AjaxTypeException
public java.lang.String KeyExceptionToJava(Output output) throws CatalogException, ExpressionException, AjaxTypeException
public void toXML(java.lang.String XMLfileName)
toXML
in interface CatalogObject
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toHtml()
protected java.lang.String writeCollection(java.util.Iterator iter, java.lang.String separator)
protected java.lang.String writeHtmlCollection(java.util.Iterator iter, java.lang.String separator)
public Output getOutputException()
public Table getOutputTable(java.lang.String tableName)
tableName
- a string representing the name of the tablepublic void setWeaveOutputsSchemas(java.io.BufferedWriter bfw) throws CatalogException, java.io.IOException
bfw
- a BufferedWriter object where to write
the generated sch codepublic void setWeaveRunTimePolicies(java.io.BufferedWriter bfw, Catalog catalog) throws CatalogException, java.io.IOException
bfw
- a BufferedWriter object where to write
the generated rtp codecatalog
- this is the catalog object which
stores all the base objects like
transormations and tablespublic static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |