MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mysql.clusterj.jdbc.SQLExecutor Class Reference
Inheritance diagram for com.mysql.clusterj.jdbc.SQLExecutor:
Collaboration diagram for com.mysql.clusterj.jdbc.SQLExecutor:

Classes

class  Delete
interface  Executor
class  Insert
class  Noop
class  Select

Public Member Functions

 SQLExecutor (DomainTypeHandlerImpl<?> domainTypeHandler, List< String > columnNames, int numberOfParameters)
 SQLExecutor (DomainTypeHandlerImpl<?> domainTypeHandler, List< String > columnNames)
 SQLExecutor (DomainTypeHandlerImpl<?> domainTypeHandler)
 SQLExecutor (DomainTypeHandlerImpl<?> domainTypeHandler, List< String > columnNames, QueryDomainTypeImpl<?> queryDomainType)
 SQLExecutor (DomainTypeHandlerImpl<?> domainTypeHandler, QueryDomainTypeImpl<?> queryDomainType, int numberOfParameters)

Protected Member Functions

Map< String, Object > createParameterMap (QueryDomainTypeImpl<?> queryDomainType, ParameterBindings parameterBindings, int offset, int count) throws SQLException
ValueHandler getValueHandler (ParameterBindings parameterBindings, int[] fieldNumberToParameterNumberMap, int offset)

Static Protected Member Functions

static void logParameterBindings (ParameterBindings parameterBindings)
static int countParameters (ParameterBindings parameterBindings)

Protected Attributes

List< StringcolumnNames = null
int numberOfFields
int numberOfParameters
int[] fieldNumberToColumnNumberMap = null
int[] columnNumberToFieldNumberMap = null
Map< String, Integer > columnNameToFieldNumberMap = new HashMap<String, Integer>()
QueryDomainTypeImpl<?> queryDomainType

Detailed Description

This class contains behavior to execute various SQL commands. There is one subclass for each command to be executed.

Definition at line 44 of file SQLExecutor.java.

Member Function Documentation

static int com.mysql.clusterj.jdbc.SQLExecutor.countParameters ( ParameterBindings  parameterBindings)
inlinestaticprotected

Count the number of bound parameters. If this is a batch execution, then the number of bound parameters is the number of statements in the batch times the number of parameters per statement. If detailed logging is enabled write the parameter bindings to the log.

Parameters
parameterBindingsthe jdbc parameter bindings

Definition at line 355 of file SQLExecutor.java.

Map<String, Object> com.mysql.clusterj.jdbc.SQLExecutor.createParameterMap ( QueryDomainTypeImpl<?>  queryDomainType,
ParameterBindings  parameterBindings,
int  offset,
int  count 
) throws SQLException
inlineprotected

Create the parameter map assigning each bound parameter a number. The result is a map in which the key is a String whose key is a cardinal number starting with 1 (for JDBC which uses 1-origin for numbering) and whose value is the parameter's value.

Parameters
queryDomainTypethe query domain type
parameterBindingsthe parameter bindings
offsetthe number of parameters to skip
countthe number of parameters to use
Returns
Exceptions
SQLException

Definition at line 251 of file SQLExecutor.java.

ValueHandler com.mysql.clusterj.jdbc.SQLExecutor.getValueHandler ( ParameterBindings  parameterBindings,
int[]  fieldNumberToParameterNumberMap,
int  offset 
)
inlineprotected

Create a value handler (part of the clusterj spi) to retrieve values from jdbc parameter bindings.

Parameters
parameterBindingsthe jdbc parameter bindings from prepared statements
fieldNumberToParameterNumberMapmap from field number to parameter number
offsetinto the parameter bindings for this instance (used for batch execution)
Returns

Definition at line 325 of file SQLExecutor.java.

static void com.mysql.clusterj.jdbc.SQLExecutor.logParameterBindings ( ParameterBindings  parameterBindings)
inlinestaticprotected

If detailed logging is enabled write the parameter bindings to the log.

Parameters
parameterBindingsthe jdbc parameter bindings

Definition at line 333 of file SQLExecutor.java.

Member Data Documentation

List<String> com.mysql.clusterj.jdbc.SQLExecutor.columnNames = null
protected

The column names in the SQL statement

Definition at line 56 of file SQLExecutor.java.

Map<String, Integer> com.mysql.clusterj.jdbc.SQLExecutor.columnNameToFieldNumberMap = new HashMap<String, Integer>()
protected

The map of column names to parameter numbers

Definition at line 71 of file SQLExecutor.java.

int [] com.mysql.clusterj.jdbc.SQLExecutor.columnNumberToFieldNumberMap = null
protected

The map of column numbers to field numbers

Definition at line 68 of file SQLExecutor.java.

int [] com.mysql.clusterj.jdbc.SQLExecutor.fieldNumberToColumnNumberMap = null
protected

The map of field numbers to parameter numbers

Definition at line 65 of file SQLExecutor.java.

int com.mysql.clusterj.jdbc.SQLExecutor.numberOfFields
protected

The number of fields in the domain object (also the number of mapped columns)

Definition at line 59 of file SQLExecutor.java.

int com.mysql.clusterj.jdbc.SQLExecutor.numberOfParameters
protected

The number of parameters in the where clause

Definition at line 62 of file SQLExecutor.java.

QueryDomainTypeImpl<?> com.mysql.clusterj.jdbc.SQLExecutor.queryDomainType
protected

The query domain type for qualified SELECT and DELETE operations

Definition at line 74 of file SQLExecutor.java.


The documentation for this class was generated from the following file: