MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mysql.clusterj.Query< E > Interface Reference
Collaboration diagram for com.mysql.clusterj.Query< E >:

Public Member Functions

void setParameter (String parameterName, Object value)
List< EgetResultList ()
int deletePersistentAll ()
Results< Eexecute (Object parameter)
Results< Eexecute (Object...parameters)
Results< Eexecute (Map< String,?> parameters)
Map< String, Object > explain ()

Static Public Attributes

static final String SCAN_TYPE = "ScanType"
static final String SCAN_TYPE_PRIMARY_KEY = "PRIMARY_KEY"
static final String SCAN_TYPE_UNIQUE_KEY = "UNIQUE_KEY"
static final String SCAN_TYPE_INDEX_SCAN = "INDEX_SCAN"
static final String SCAN_TYPE_TABLE_SCAN = "TABLE_SCAN"
static final String INDEX_USED = "IndexUsed"

Detailed Description

A Query instance represents a specific query with bound parameters. The instance is created by the method com.mysql.clusterj.Session#createQuery.

Definition at line 27 of file Query.java.

Member Function Documentation

int com.mysql.clusterj.Query< E >.deletePersistentAll ( )

Delete the instances that satisfy the query criteria.

Returns
the number of instances deleted
Results<E> com.mysql.clusterj.Query< E >.execute ( Object  parameter)

Execute the query with exactly one parameter.

Parameters
parameterthe parameter
Returns
the result
Results<E> com.mysql.clusterj.Query< E >.execute ( Object...  parameters)

Execute the query with one or more parameters. Parameters are resolved in the order they were declared in the query.

Parameters
parametersthe parameters
Returns
the result
Results<E> com.mysql.clusterj.Query< E >.execute ( Map< String,?>  parameters)

Execute the query with one or more named parameters. Parameters are resolved by name.

Parameters
parametersthe parameters
Returns
the result
Map<String, Object> com.mysql.clusterj.Query< E >.explain ( )

Explain how this query will be or was executed. If called before binding all parameters, throws ClusterJUserException. Return a map of key:value pairs that explain how the query will be or was executed. Details can be obtained by calling toString on the value. The following keys are returned:

  • ScanType: the type of scan, with values:
    • PRIMARY_KEY: the query used key lookup with the primary key
    • UNIQUE_KEY: the query used key lookup with a unique key
    • INDEX_SCAN: the query used a range scan with a non-unique key
    • TABLE_SCAN: the query used a table scan
  • IndexUsed: the name of the index used, if any
Returns
the data about the execution of this query
Exceptions
ClusterJUserExceptionif not all parameters are bound
List<E> com.mysql.clusterj.Query< E >.getResultList ( )

Get the results as a list.

Returns
the result
Exceptions
ClusterJUserExceptionif not all parameters are bound
ClusterJDatastoreExceptionif an exception is reported by the datastore
void com.mysql.clusterj.Query< E >.setParameter ( String  parameterName,
Object  value 
)

Set the value of a parameter. If called multiple times for the same parameter, silently replace the value.

Parameters
parameterNamethe name of the parameter
valuethe value for the parameter

Member Data Documentation

final String com.mysql.clusterj.Query< E >.INDEX_USED = "IndexUsed"
static

The query explain index used key

Definition at line 45 of file Query.java.

final String com.mysql.clusterj.Query< E >.SCAN_TYPE = "ScanType"
static

The query explain scan type key

Definition at line 30 of file Query.java.

final String com.mysql.clusterj.Query< E >.SCAN_TYPE_INDEX_SCAN = "INDEX_SCAN"
static

The query explain scan type value for index scan

Definition at line 39 of file Query.java.

final String com.mysql.clusterj.Query< E >.SCAN_TYPE_PRIMARY_KEY = "PRIMARY_KEY"
static

The query explain scan type value for primary key

Definition at line 33 of file Query.java.

final String com.mysql.clusterj.Query< E >.SCAN_TYPE_TABLE_SCAN = "TABLE_SCAN"
static

The query explain scan type value for table scan

Definition at line 42 of file Query.java.

final String com.mysql.clusterj.Query< E >.SCAN_TYPE_UNIQUE_KEY = "UNIQUE_KEY"
static

The query explain scan type value for unique key

Definition at line 36 of file Query.java.


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