public class SelectQueryPlan extends QueryPlan
| Modifier and Type | Field and Description |
|---|---|
protected Constraint |
constraint
Pointer to the retrieve descriptor's constraint stack.
|
static String |
MULTILEVEL_PREFETCH_PROPERTY
Name of the MULTILEVEL_PREFETCH property.
|
int |
options
Bitmask constaining OPT_* Constants defined in
RetrieveDescImpl |
protected ForeignFieldDesc |
parentField
This foreign field joins this plan to the parent plan.
|
static int |
ST_C_BUILT
This plans's constraints are already processed.
|
static int |
ST_OC_BUILT
This plans's order by constraints are already processed.
|
ACT_DELETE, ACT_INSERT, ACT_NOOP, ACT_SELECT, ACT_UPDATE, action, config, messages, ST_BUILT, statements, status, store, tables| Constructor and Description |
|---|
SelectQueryPlan(ActionDesc desc,
SQLStoreManager store,
Concurrency concurrency)
Creates a new SelectQueryPlan.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addColumn(LocalFieldDesc fieldDesc)
The addColumn method is used to specify a field for which data needs
to be retrieved and therefore for which we need to select a column.
|
protected void |
addJoinConstraint(SelectQueryPlan fromPlan,
SelectQueryPlan toPlan,
ArrayList fromColumns,
ArrayList toColumns,
int joinOp)
Put in a join constraint to the foreign table.
|
protected void |
addTable(LocalFieldDesc fieldDesc)
The addTable method is used to add tables correponding to a field to the plan.
|
void |
build()
Builds the query plan for a select type
ActionDesc (i.e. |
Constraint |
getConstraint() |
Object |
getResult(PersistenceManager pm,
ResultSet resultData)
Extract data from given
resultData |
static SelectQueryPlan |
newInstance(RetrieveDescImpl desc,
SQLStoreManager store,
Concurrency concurrency)
Creates a new instance of SelectQueryPlan depending on the retrieve
descriptor options.
|
protected Statement |
newStatement() |
protected void |
processConstraints() |
protected void |
processFields()
Process the fields from the retrieve descriptor's field list.
|
void |
processOrderConstraints()
Converts ConstraintFieldName used in Order by constraints into
ConstraintFieldDesc using ConstraintFieldName#originalPlan.
Currently unused functionality: Gets all the "order by" constraints from the the current stack. |
protected void |
processStatements()
This method goes through the statement list and tries to set up relationship
between statements based on secondary table keys.
|
addQueryTable, addQueryTable, addQueryTables, addStatement, createStatement, findQueryTable, findQueryTable, getAction, getConfig, getStatement, getStatementspublic static final int ST_C_BUILT
public static final int ST_OC_BUILT
protected Constraint constraint
public int options
RetrieveDescImplprotected ForeignFieldDesc parentField
public static final String MULTILEVEL_PREFETCH_PROPERTY
public SelectQueryPlan(ActionDesc desc, SQLStoreManager store, Concurrency concurrency)
desc - Retrieve descriptor holding the query information
from the query compiler. This information includes selected
fields and the query constraints. desc must be an
instance of RetrieveDescImpl.store - Store manager executing the query.concurrency - Query concurrency.public static SelectQueryPlan newInstance(RetrieveDescImpl desc, SQLStoreManager store, Concurrency concurrency)
desc - The retrieve descriptorstore - The storeconcurrency - The concurrency for the plan.public Constraint getConstraint()
protected void addTable(LocalFieldDesc fieldDesc)
fieldDesc - The field for which we need to add tableprotected void addColumn(LocalFieldDesc fieldDesc)
fieldDesc - The field for which we need to retrieve data and therefore
for which we need to select a column.protected void processStatements()
QueryPlanprocessStatements in class QueryPlanpublic void build()
ActionDesc (i.e. a RetrieveDesc).protected void processFields()
protected void processConstraints()
protected void addJoinConstraint(SelectQueryPlan fromPlan, SelectQueryPlan toPlan, ArrayList fromColumns, ArrayList toColumns, int joinOp)
fromPlan - The plan for fromColumnstoPlan - The plan for toColumnsfromColumns - List of local columns.toColumns - List of foreign columns.joinOp - Join operation. This operation is never a non relationship join.public void processOrderConstraints()
protected Statement newStatement()
newStatement in class QueryPlanpublic Object getResult(PersistenceManager pm, ResultSet resultData) throws SQLException
resultDatapm - The PersistenceManager.resultData - The result set from which data is to be extracted.resultDataSQLExceptionCopyright © 2017. All rights reserved.