it.eng.spagobi.commons.services
Class DelegatedQueryExecutor

java.lang.Object
  extended by it.eng.spago.util.QueryExecutor
      extended by it.eng.spagobi.commons.services.DelegatedQueryExecutor

public class DelegatedQueryExecutor
extends it.eng.spago.util.QueryExecutor


Field Summary
static java.lang.String CREATE
           
static java.lang.String DELETE
           
static java.lang.String READ
           
static java.lang.String UPDATE
           
 
Constructor Summary
DelegatedQueryExecutor()
           
 
Method Summary
static it.eng.spago.dbaccess.sql.SQLCommand createStatementSql(it.eng.spago.dbaccess.sql.DataConnection dataConnection, java.lang.String statement, java.lang.String type)
          Creates the command to execute dependent on request type.
static java.lang.Object executeQuery(it.eng.spago.dbaccess.sql.DataConnection dataConnection, java.lang.String type, it.eng.spago.base.SourceBean query, java.util.ArrayList parameters)
          Execs statement SQL with explicit parameters.
protected static java.lang.Object executeQuery(it.eng.spago.dbaccess.sql.DataConnection dataConnection, java.lang.String statement, java.lang.String type, java.util.ArrayList inputParameters)
           
static java.lang.Object executeQuery(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer, it.eng.spago.dbaccess.sql.DataConnection dataConnection, it.eng.spago.base.SourceBean query, java.lang.String type)
          Execs the commands: SQL SELECT, INSERT, DELETE, UPDATE.
static java.lang.Object executeQuery(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer, java.lang.String pool, it.eng.spago.base.SourceBean query, java.lang.String type)
          Execs the commands: SQL SELECT, INSERT, DELETE, UPDATE.
protected static boolean handleFilterParameter(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer, it.eng.spago.base.SourceBean parameter, java.util.ArrayList inputParameters, it.eng.spago.dbaccess.sql.DataConnection dataConnection, java.lang.StringBuffer statement, java.lang.String condizioneSql)
          Treatment of Filter's parameters
protected static void handleOrderByParameter(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer, it.eng.spago.base.SourceBean parameter, java.lang.StringBuffer statement, java.lang.String condizioneSql)
          Management of option ORDER_BY
protected static boolean handleParameter(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer, it.eng.spago.base.SourceBean parameter, java.util.ArrayList inputParameters, it.eng.spago.dbaccess.sql.DataConnection dataConnection)
          Treatment of standard parameters
protected static boolean handleParameter(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer, it.eng.spago.base.SourceBean parameter, java.util.ArrayList inputParameters, it.eng.spago.dbaccess.sql.DataConnection dataConnection, boolean isFilterParameter, java.lang.StringBuffer statement, java.lang.String condizioneSql)
          General management for normal and filter parameters
static it.eng.spago.dbaccess.sql.DataConnection openConnection(java.lang.String pool)
          Opens the pool connection.
 
Methods inherited from class it.eng.spago.util.QueryExecutor
handleOrderByParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE

public static final java.lang.String CREATE
See Also:
Constant Field Values

READ

public static final java.lang.String READ
See Also:
Constant Field Values

UPDATE

public static final java.lang.String UPDATE
See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
See Also:
Constant Field Values
Constructor Detail

DelegatedQueryExecutor

public DelegatedQueryExecutor()
Method Detail

createStatementSql

public static it.eng.spago.dbaccess.sql.SQLCommand createStatementSql(it.eng.spago.dbaccess.sql.DataConnection dataConnection,
                                                                      java.lang.String statement,
                                                                      java.lang.String type)
Creates the command to execute dependent on request type.

Parameters:
dataConnection - the data connection
type - type of query to execute: CREATE, READ, UPDATE, DELETE
statement - the statement
Returns:
the SQL command

openConnection

public static it.eng.spago.dbaccess.sql.DataConnection openConnection(java.lang.String pool)
                                                               throws it.eng.spago.error.EMFInternalError
Opens the pool connection.

Parameters:
pool - the pool
Returns:
the data connection
Throws:
it.eng.spago.error.EMFInternalError - the EMF internal error

executeQuery

public static java.lang.Object executeQuery(it.eng.spago.base.RequestContainer requestContainer,
                                            it.eng.spago.base.ResponseContainer responseContainer,
                                            java.lang.String pool,
                                            it.eng.spago.base.SourceBean query,
                                            java.lang.String type)
Execs the commands: SQL SELECT, INSERT, DELETE, UPDATE. The connection is gone by the connection pool.

Parameters:
requestContainer - the request container
responseContainer - the response container
pool - pool's name
query - the SourceBean that contains the configuration of the query
type - type of query: CREATE, READ, UPDATE, DELETE
Returns:
the object

executeQuery

public static java.lang.Object executeQuery(it.eng.spago.base.RequestContainer requestContainer,
                                            it.eng.spago.base.ResponseContainer responseContainer,
                                            it.eng.spago.dbaccess.sql.DataConnection dataConnection,
                                            it.eng.spago.base.SourceBean query,
                                            java.lang.String type)
Execs the commands: SQL SELECT, INSERT, DELETE, UPDATE. The connection is taken by parameter (for manually transactions)

Parameters:
requestContainer - the request container
responseContainer - the response container
dataConnection - connection on db
query - the SourceBean that contains the configuration
type - type of query: CREATE, READ, UPDATE, DELETE
Returns:
the object

executeQuery

public static java.lang.Object executeQuery(it.eng.spago.dbaccess.sql.DataConnection dataConnection,
                                            java.lang.String type,
                                            it.eng.spago.base.SourceBean query,
                                            java.util.ArrayList parameters)
                                     throws java.lang.Exception
Execs statement SQL with explicit parameters.

Parameters:
dataConnection - connection on database:
type - type of query: CREATE, READ, UPDATE, DELETE
query - the SourceBean that contains the configuration of the query
parameters - The parameters to add into statement
Returns:
the object
Throws:
java.lang.Exception - the exception

executeQuery

protected static java.lang.Object executeQuery(it.eng.spago.dbaccess.sql.DataConnection dataConnection,
                                               java.lang.String statement,
                                               java.lang.String type,
                                               java.util.ArrayList inputParameters)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

handleParameter

protected static boolean handleParameter(it.eng.spago.base.RequestContainer requestContainer,
                                         it.eng.spago.base.ResponseContainer responseContainer,
                                         it.eng.spago.base.SourceBean parameter,
                                         java.util.ArrayList inputParameters,
                                         it.eng.spago.dbaccess.sql.DataConnection dataConnection)
Treatment of standard parameters

Parameters:
requestContainer -
responseContainer -
parameter -
inputParameters -
dataConnection -
Returns:

handleFilterParameter

protected static boolean handleFilterParameter(it.eng.spago.base.RequestContainer requestContainer,
                                               it.eng.spago.base.ResponseContainer responseContainer,
                                               it.eng.spago.base.SourceBean parameter,
                                               java.util.ArrayList inputParameters,
                                               it.eng.spago.dbaccess.sql.DataConnection dataConnection,
                                               java.lang.StringBuffer statement,
                                               java.lang.String condizioneSql)
Treatment of Filter's parameters

Parameters:
requestContainer -
responseContainer -
parameter -
inputParameters -
dataConnection -
statement -
condizioneSql -
Returns:

handleParameter

protected static boolean handleParameter(it.eng.spago.base.RequestContainer requestContainer,
                                         it.eng.spago.base.ResponseContainer responseContainer,
                                         it.eng.spago.base.SourceBean parameter,
                                         java.util.ArrayList inputParameters,
                                         it.eng.spago.dbaccess.sql.DataConnection dataConnection,
                                         boolean isFilterParameter,
                                         java.lang.StringBuffer statement,
                                         java.lang.String condizioneSql)
General management for normal and filter parameters

Parameters:
requestContainer -
responseContainer -
parameter -
inputParameters -
dataConnection -
isFilterParameter -
statement -
condizioneSql -
Returns:

handleOrderByParameter

protected static void handleOrderByParameter(it.eng.spago.base.RequestContainer requestContainer,
                                             it.eng.spago.base.ResponseContainer responseContainer,
                                             it.eng.spago.base.SourceBean parameter,
                                             java.lang.StringBuffer statement,
                                             java.lang.String condizioneSql)
Management of option ORDER_BY

Parameters:
parameter -
statement -
condizioneSql -