org.makumba.providers
Interface SQLParameterTransformer

All Known Implementing Classes:
MqlSQLParameterTransformer

public interface SQLParameterTransformer

Generates the SQL query to be executed against the DBMS, together with the transformed query parameters. Implementations of this interface also take care of makumba-specific concerns regarding query parameters:

Version:
$Id: SQLQueryGenerator.java,v 1.1 Mar 3, 2010 6:50:10 PM manu Exp $
Author:
Manuel Gay

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
 void init(Map<String,Object> arguments)
          Initialises the SQLQueryGenerator.
 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)
 

Method Detail

init

void init(Map<String,Object> arguments)
Initialises the SQLQueryGenerator. Called at resource configuration time


getSQLQuery

String getSQLQuery(NameResolver nr)
Provides the SQL query to be executed on the DBMS, with expanded and transformed parameters

Parameters:
nr - the NameResolver used to resolve database-level table and field names
Returns:
the expanded SQL query String

toArgumentArray

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)

Returns:
an object array containing the ordered parameter values

getSQLQueryArgumentTypes

DataDefinition getSQLQueryArgumentTypes()
Gets the types of the arguments

Returns:
a DataDefinition with the types of all the arguments

getArgumentCount

int getArgumentCount()
The number of arguments of the query