public class Select extends Query
distinct, limitExpr, offsetExpr, randomAccessResult, sampleSizeExprcreate, parameters, prepareAlways, session, sqlStatement| 限定符和类型 | 方法和说明 |
|---|---|
void |
addCondition(Expression cond)
Add a condition to the list of conditions.
|
void |
addGlobalCondition(Parameter param,
int columnId,
int comparisonType)
Add a condition to the query.
|
void |
addTableFilter(TableFilter filter,
boolean isTop)
Add a table to the query.
|
boolean |
allowGlobalConditions()
Check whether adding condition to the query is allowed.
|
void |
fireBeforeSelectTriggers()
Call the before triggers on all tables.
|
int |
getColumnCount()
Get the column count of this query.
|
double |
getCost()
Calculate the cost to execute this query.
|
HashMap<Expression,Object> |
getCurrentGroup() |
int |
getCurrentGroupRowId() |
ArrayList<Expression> |
getExpressions()
The the list of select expressions.
|
ArrayList<Expression> |
getGroupBy() |
Expression |
getHaving() |
JoinBatch |
getJoinBatch() |
String |
getPlanSQL()
Get the SQL statement with the execution plan.
|
SortOrder |
getSortOrder() |
HashSet<Table> |
getTables()
Get all tables that are involved in this query.
|
ArrayList<TableFilter> |
getTopFilters() |
TableFilter |
getTopTableFilter() |
int |
getType()
Get the command type as defined in CommandInterface
|
boolean |
hasOrder()
Whether the query has an order.
|
void |
init()
Initialize the query.
|
boolean |
isCacheable() |
boolean |
isEverything(ExpressionVisitor visitor)
Check if this expression and all sub-expressions can fulfill a criteria.
|
boolean |
isQuickAggregateQuery()
Check if this is an aggregate query with direct lookup, for example a
query of the type SELECT COUNT(*) FROM TEST or
SELECT MAX(ID) FROM TEST.
|
boolean |
isReadOnly()
Check if this command is read only.
|
boolean |
isUnion()
Check if this is a UNION query.
|
void |
mapColumns(ColumnResolver resolver,
int level)
Map the columns to the given column resolver.
|
void |
prepare()
Prepare this statement.
|
void |
prepareJoinBatch()
Prepare join batching.
|
ResultInterface |
queryMeta()
Get an empty result set containing the meta data.
|
protected LocalResult |
queryWithoutCache(int maxRows,
ResultTarget target)
Execute the query without checking the cache.
|
void |
setEvaluatable(TableFilter tableFilter,
boolean b)
Change the evaluatable flag.
|
void |
setExpressions(ArrayList<Expression> expressions) |
void |
setForUpdate(boolean b)
Set the 'for update' flag.
|
void |
setGroupBy(ArrayList<Expression> group) |
void |
setGroupQuery()
Called if this query contains aggregate functions.
|
void |
setHaving(Expression having) |
void |
setOrder(ArrayList<SelectOrderBy> order)
Set the order by list.
|
void |
updateAggregate(Session s)
Update all aggregate function values.
|
disableCache, getCostAsExpression, getLimit, getMaxDataModificationId, getOffset, getParameterValues, isDistinct, isQuery, isTransactional, prepareOrder, query, setDistinct, setLimit, setOffset, setRandomAccessResult, setSampleSizecheckCanceled, checkParameters, getCurrentObjectId, getCurrentRowNumber, getObjectId, getParameters, getSQL, getSQL, getSQL, needRecompile, setCommand, setCurrentRowNumber, setObjectId, setParameterList, setPrepareAlways, setRow, setSession, setSQL, toString, updatepublic Select(Session session)
public boolean isUnion()
Querypublic void addTableFilter(TableFilter filter, boolean isTop)
filter - the table to addisTop - if the table can be the first table in the query planpublic ArrayList<TableFilter> getTopFilters()
public void setExpressions(ArrayList<Expression> expressions)
public void setGroupQuery()
public void setGroupBy(ArrayList<Expression> group)
public ArrayList<Expression> getGroupBy()
public HashMap<Expression,Object> getCurrentGroup()
public int getCurrentGroupRowId()
public void setOrder(ArrayList<SelectOrderBy> order)
Querypublic boolean hasOrder()
Querypublic void addCondition(Expression cond)
cond - the condition to addpublic ResultInterface queryMeta()
Preparedprotected LocalResult queryWithoutCache(int maxRows, ResultTarget target)
QueryqueryWithoutCache 在类中 QuerymaxRows - the limit as specified in the JDBC method calltarget - the target to write results topublic void prepareJoinBatch()
QueryprepareJoinBatch 在类中 Querypublic JoinBatch getJoinBatch()
public double getCost()
Querypublic HashSet<Table> getTables()
Querypublic void fireBeforeSelectTriggers()
QueryfireBeforeSelectTriggers 在类中 Querypublic String getPlanSQL()
PreparedgetPlanSQL 在类中 Preparedpublic void setHaving(Expression having)
public Expression getHaving()
public int getColumnCount()
QuerygetColumnCount 在类中 Querypublic TableFilter getTopTableFilter()
public ArrayList<Expression> getExpressions()
QuerygetExpressions 在类中 Querypublic void setForUpdate(boolean b)
QuerysetForUpdate 在类中 Queryb - the new settingpublic void mapColumns(ColumnResolver resolver, int level)
QuerymapColumns 在类中 Queryresolver - the resolverlevel - the subquery level (0 is the top level query, 1 is the first
subquery level)public void setEvaluatable(TableFilter tableFilter, boolean b)
QuerysetEvaluatable 在类中 QuerytableFilter - the table filterb - the new valuepublic boolean isQuickAggregateQuery()
public void addGlobalCondition(Parameter param, int columnId, int comparisonType)
QueryaddGlobalCondition 在类中 Queryparam - the parametercolumnId - the column index (0 meaning the first column)comparisonType - the comparison typepublic void updateAggregate(Session s)
QueryupdateAggregate 在类中 Querys - the sessionpublic boolean isEverything(ExpressionVisitor visitor)
QueryisEverything 在类中 Queryvisitor - the visitorpublic boolean isReadOnly()
PreparedisReadOnly 在类中 Preparedpublic boolean isCacheable()
isCacheable 在类中 Preparedpublic int getType()
Preparedpublic boolean allowGlobalConditions()
QueryallowGlobalConditions 在类中 Querypublic SortOrder getSortOrder()
Copyright © 2017. All rights reserved.