ajax.catalog
Class EmbeddedQuery

java.lang.Object
  |
  +--ajax.catalog.Transformation
        |
        +--ajax.catalog.EmbeddedQuery
All Implemented Interfaces:
CatalogObject

public class EmbeddedQuery
extends Transformation


Fields inherited from class ajax.catalog.Transformation
CLUST, DBTransferStr, dirExec, dirFiles, dirFunctions, embeddedOutput, endEvaluateHeader, evaluateHeader, evaluateTail, exceptionOutput, FROM_FILE, FROM_TABLE, generatedCodeType, ifTail, importIOException, importList, importRunnableTransf, importSqlException, importSqlResultSet, importWrapperException, importWrapperManager, inputType, JAVA_CODE, MAPP, MATCH, MERG, newLine, outerOutput, outputType, SQL_CODE, tail, TO_FILE, TO_TABLE, transfType, VIEW, wrapperInitialization
 
Constructor Summary
EmbeddedQuery(java.lang.String outputName, Transformation context)
          The ctor of this class.
 
Method Summary
 void asArrayToJava(java.io.Writer outStream, Expression variable)
          This method translates an EmbeddedQuery object into Java code when the EmbeddedQuery corresponds to a query whose result is assigned to a variable declared in the LET clause of the context transformation.
 void init(java.util.List outerFrom)
          Fills in the components of a mapping transformation.
 void set(java.util.LinkedList output, java.util.List from, Expression where)
          Set some attributes of this class.
 java.lang.String toHtml()
          Converts the EmbeddedQuery to html format.
 void toJavaBody(java.io.Writer outStream)
          functions that writes the body of this transformation using the Java language.
protected  void toJavaBody(java.io.Writer outStream, Table[] matTable)
          Generates code for executing the body of the transformation We are using the exception table of the context transformation to store possible exceptions that may arise in the execution of this transformation.
 java.lang.String toString()
          Converts the EmbeddedQuery into a human read-able object.
 void toXML(java.lang.String XMLfileName)
          Converts the transformation into an XML document
 
Methods inherited from class ajax.catalog.Transformation
addAsList, addEmbeddedQuery, closeFile, closeOutputFiles, closeOutputJdbc, createOutputFiles, createOutputTables, declareTransfer, doOuterJoinInSQL, dump, dumpQuery, exceptionsToJava, fromToSQL, getAllOutputNames, getExceptionsLet, getExceptionTable, getFields, getFieldType, getFrom, getIndex, getIndexAttribute, getInputNames, getInputTable, getKey, getKeyAs, getLet, getMatTable, getName, getOutput, getOutput, getOutputException, getOutputNames, getOutputSize, getOutputTable, getTable, getTransfType, getWhere, hasNullConstraint, init, initialize, isClustering, isFromTable, isLetOptimizableDE, isLetToSQL, isMapping, isMatching, isMerging, isToSQL, isToTable, isTransformation, isView, KeyExceptionToJava, letToJava, load, main, openFile, outerOutputIter, selectToJava, selectToSQL, selectToSQLToTable, setExceptionOutput, setFromFile, setFromTable, setName, setOuterOutput, setToFile, setToJava, setToSQL, setToTable, setWeaveOutputsSchemas, setWeaveRunTimePolicies, toJava, toJavaFromInput, toJavaQuery, toSQL, toTableQuery, updateAuxiliaryFunctions, whereToJava, whereToSQL, writeCollection, writeHtmlCollection, writeTailClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmbeddedQuery

public EmbeddedQuery(java.lang.String outputName,
                     Transformation context)
The ctor of this class.
Method Detail

set

public final void set(java.util.LinkedList output,
                      java.util.List from,
                      Expression where)
Set some attributes of this class.

init

public void init(java.util.List outerFrom)
          throws CatalogException,
                 AjaxTypeException
Fills in the components of a mapping transformation. This method is called after the context transformation have been initialized.

toJavaBody

public final void toJavaBody(java.io.Writer outStream)
                      throws CatalogException,
                             java.io.IOException,
                             ExpressionException,
                             AjaxTypeException
functions that writes the body of this transformation using the Java language.

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 We are using the exception table of the context transformation to store possible exceptions that may arise in the execution of this transformation.
Overrides:
toJavaBody in class Transformation

asArrayToJava

public void asArrayToJava(java.io.Writer outStream,
                          Expression variable)
                   throws CatalogException,
                          java.io.IOException,
                          ExpressionException,
                          AjaxTypeException
This method translates an EmbeddedQuery object into Java code when the EmbeddedQuery corresponds to a query whose result is assigned to a variable declared in the LET clause of the context transformation. This solution only works for embedded queries which "return" arrays of strings. For other types of return (Integer, Float, ...), we need to change the method toJava (or to use a different one) of expression in order use the getObject(index) instead of using getString, getInt, ... .
Parameters:
variable - is the variable which describe the expression that contains the assignment of this embedded query.

toXML

public void toXML(java.lang.String XMLfileName)
Converts the transformation into an XML document
Overrides:
toXML in class Transformation

toString

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

toHtml

public java.lang.String toHtml()
Converts the EmbeddedQuery to html format.
Overrides:
toHtml in class Transformation