org.makumba.providers.query.mql
Class MqlSQLParameterTransformer

java.lang.Object
  extended by org.makumba.providers.query.mql.MqlSQLParameterTransformer
All Implemented Interfaces:
SQLParameterTransformer

public class MqlSQLParameterTransformer
extends Object
implements SQLParameterTransformer

MQL implementation of the SQLParameterTransformer, which generates SQL based on a QueryAnalysis

Version:
$Id: MqlSQLQueryGenerator.java,v 1.1 Mar 30, 2010 4:17:00 PM manu Exp $
Author:
Manuel Gay

Constructor Summary
MqlSQLParameterTransformer(MqlQueryAnalysis qA)
           
 
Method Summary
 int getArgumentCount()
          The number of arguments of the query
 String getSQLQuery(NameResolver nr)
          Provides the SQL query to be executed on the DBMS, with expanded and transformed parameters
 DataDefinition getSQLQueryArgumentTypes()
          Gets the types of the arguments
static MqlSQLParameterTransformer getSQLQueryGenerator(MqlQueryAnalysis qA, Map<String,Object> args)
           
 void init(Map<String,Object> arguments)
          Initialises the SQLQueryGenerator.
static void main(String[] args)
           
 Object[] toArgumentArray(Map<String,Object> arguments)
          Provides the arguments necessary in order to execute the query on the DBMS, in the order following the one of the query returned by #getSQLQuery(NameResolver, Object)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MqlSQLParameterTransformer

public MqlSQLParameterTransformer(MqlQueryAnalysis qA)
Method Detail

init

public void init(Map<String,Object> arguments)
Description copied from interface: SQLParameterTransformer
Initialises the SQLQueryGenerator. Called at resource configuration time

Specified by:
init in interface SQLParameterTransformer

getArgumentCount

public int getArgumentCount()
Description copied from interface: SQLParameterTransformer
The number of arguments of the query

Specified by:
getArgumentCount in interface SQLParameterTransformer

getSQLQueryArgumentTypes

public DataDefinition getSQLQueryArgumentTypes()
Description copied from interface: SQLParameterTransformer
Gets the types of the arguments

Specified by:
getSQLQueryArgumentTypes in interface SQLParameterTransformer
Returns:
a DataDefinition with the types of all the arguments

getSQLQuery

public String getSQLQuery(NameResolver nr)
Description copied from interface: SQLParameterTransformer
Provides the SQL query to be executed on the DBMS, with expanded and transformed parameters

Specified by:
getSQLQuery in interface SQLParameterTransformer
Parameters:
nr - the NameResolver used to resolve database-level table and field names
Returns:
the expanded SQL query String

toArgumentArray

public Object[] toArgumentArray(Map<String,Object> arguments)
Description copied from interface: SQLParameterTransformer
Provides the arguments necessary in order to execute the query on the DBMS, in the order following the one of the query returned by #getSQLQuery(NameResolver, Object)

Specified by:
toArgumentArray in interface SQLParameterTransformer
Returns:
an object array containing the ordered parameter values

getSQLQueryGenerator

public static MqlSQLParameterTransformer getSQLQueryGenerator(MqlQueryAnalysis qA,
                                                              Map<String,Object> args)

main

public static void main(String[] args)