|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.command.Prepared
org.h2.command.dml.Query
public abstract class Query
Represents a SELECT statement (simple, or union).
Field Summary | |
---|---|
protected Expression |
limitExpr
The limit expression as specified in the LIMIT or TOP clause. |
protected Expression |
offsetExpr
The offset expression as specified in the LIMIT .. |
protected int |
sampleSize
The sample size |
Fields inherited from class org.h2.command.Prepared |
---|
create, parameters, prepareAlways, session, sqlStatement |
Constructor Summary | |
---|---|
Query(Session session)
|
Method Summary | |
---|---|
abstract void |
addGlobalCondition(Parameter param,
int columnId,
int comparisonType)
Add a condition to the query. |
abstract void |
fireBeforeSelectTriggers()
Call the before triggers on all tables. |
abstract int |
getColumnCount()
Get the column count of this query. |
abstract double |
getCost()
Calculate the cost to execute this query. |
abstract java.util.ArrayList<Expression> |
getExpressions()
The the list of select expressions. |
long |
getMaxDataModificationId()
|
Value[] |
getParameterValues()
|
abstract java.util.HashSet<Table> |
getTables()
Get all tables that are involved in this query. |
abstract void |
init()
Initialize the query. |
abstract boolean |
isEverything(ExpressionVisitor visitor)
Check if this expression and all sub-expressions can fulfill a criteria. |
boolean |
isEverything(int expressionVisitorType)
Visit all expressions and subqueries in this query using the visitor pattern. |
boolean |
isQuery()
Check if this object is a query. |
boolean |
isTransactional()
Check if this command is transactional. |
abstract void |
mapColumns(ColumnResolver resolver,
int level)
Map the columns to the given column resolver. |
SortOrder |
prepareOrder(java.util.ArrayList<SelectOrderBy> orderList,
int expressionCount)
Create a SortOrder object given the list of SelectOrderBy
objects. |
ResultInterface |
query(int maxrows)
Execute the query. |
protected abstract LocalResult |
queryWithoutCache(int limit,
ResultTarget target)
Execute the query without checking the cache. |
abstract void |
setDistinct(boolean b)
Set the distinct flag. |
abstract void |
setEvaluatable(TableFilter tableFilter,
boolean b)
Change the evaluatable flag. |
abstract void |
setForUpdate(boolean forUpdate)
Set the 'for update' flag. |
void |
setLimit(Expression limit)
|
void |
setOffset(Expression offset)
|
abstract void |
setOrder(java.util.ArrayList<SelectOrderBy> order)
Set the order by list. |
void |
setSampleSize(int sampleSize)
|
abstract void |
updateAggregate(Session s)
Update all aggregate function values. |
Methods inherited from class org.h2.command.Prepared |
---|
checkCanceled, checkParameters, getCurrentObjectId, getCurrentRowNumber, getObjectId, getParameters, getPlanSQL, getSQL, getSQL, getSQL, getType, isCacheable, isReadOnly, needRecompile, prepare, queryMeta, setCommand, setCurrentRowNumber, setObjectId, setParameterList, setPrepareAlways, setRow, setSession, setSQL, toString, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Expression limitExpr
protected Expression offsetExpr
protected int sampleSize
Constructor Detail |
---|
public Query(Session session)
Method Detail |
---|
protected abstract LocalResult queryWithoutCache(int limit, ResultTarget target)
limit
- the limit as specified in the JDBC method calltarget
- the target to write results to
public abstract void init()
public abstract java.util.ArrayList<Expression> getExpressions()
public abstract double getCost()
public abstract java.util.HashSet<Table> getTables()
public abstract void setOrder(java.util.ArrayList<SelectOrderBy> order)
order
- the order by listpublic abstract void setForUpdate(boolean forUpdate)
forUpdate
- the new settingpublic abstract int getColumnCount()
public abstract void mapColumns(ColumnResolver resolver, int level)
resolver
- the resolverlevel
- the subquery level (0 is the top level query, 1 is the first
subquery level)public abstract void setEvaluatable(TableFilter tableFilter, boolean b)
tableFilter
- the table filterb
- the new valuepublic abstract void addGlobalCondition(Parameter param, int columnId, int comparisonType)
param
- the parametercolumnId
- the column index (0 meaning the first column)comparisonType
- the comparison typepublic abstract void setDistinct(boolean b)
b
- the new valuepublic abstract boolean isEverything(ExpressionVisitor visitor)
visitor
- the visitor
public abstract void updateAggregate(Session s)
s
- the sessionpublic abstract void fireBeforeSelectTriggers()
public boolean isQuery()
Prepared
isQuery
in class Prepared
public boolean isTransactional()
Prepared
isTransactional
in class Prepared
public final Value[] getParameterValues()
public ResultInterface query(int maxrows)
Prepared
query
in class Prepared
maxrows
- the maximum number of rows to return
public SortOrder prepareOrder(java.util.ArrayList<SelectOrderBy> orderList, int expressionCount)
SortOrder
object given the list of SelectOrderBy
objects. The expression list is extended if necessary.
orderList
- a list of SelectOrderBy
elementsexpressionCount
- the number of columns in the query
SortOrder
objectpublic void setOffset(Expression offset)
public void setLimit(Expression limit)
public void setSampleSize(int sampleSize)
public final long getMaxDataModificationId()
public final boolean isEverything(int expressionVisitorType)
expressionVisitorType
- the visitor type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |