Top Description Inners Fields Constructors Methods
org.h2.command.query

public abstract Class Query

extends Prepared
Class Inheritance
Known Direct Subclasses
org.h2.command.query.Select, org.h2.command.query.SelectUnion, org.h2.command.query.TableValueConstructor
Static Imports
org.h2.expression.Expression.WITHOUT_PARENTHESES, org.h2.util.HasSQL.DEFAULT_SQL_FLAGS

Represents a SELECT statement (simple, or union).

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
Query.OffsetFetch

Evaluated values of OFFSET and FETCH clauses.

Field Summary

Modifier and TypeField and Description
private boolean
pack-priv boolean
pack-priv boolean
distinct

Whether the result must only contain distinct rows.

pack-priv Expression[]
expressionArray

Array of expressions.

pack-priv ArrayList<Expression>
expressions

The column list, including invisible expressions such as order by expressions.

pack-priv Expression
fetchExpr

The fetch expression as specified in the FETCH, LIMIT, or TOP clause.

pack-priv boolean
fetchPercent

Whether limit expression specifies percentage of rows.

pack-priv boolean
private long
private Boolean
private long
private Value[]
private ResultInterface
private boolean
private boolean
pack-priv Expression
offsetExpr

The offset expression as specified in the OFFSET clause.

pack-priv ArrayList<QueryOrderBy>
orderList

Describes elements of the ORDER BY clause of a query.

private QueryScope
outerQueryScope

The outer scope of this query.

pack-priv boolean
randomAccessResult

Whether the result needs to support random access.

pack-priv int
resultColumnCount

Number of columns including visible columns and additional virtual columns for ORDER BY and DISTINCT ON clauses.

pack-priv SortOrder
sort

A sort order represents an ORDER BY clause in a query.

pack-priv int
visibleColumnCount

The visible columns (the ones required in the result).

private LinkedHashMap<String, Table>
withClause

The WITH clause of this query.

pack-priv boolean
withTies

Whether tied rows should be included in result too.

Inherited from org.h2.command.Prepared:
createparametersprepareAlwayssessionsqlStatementsqlTokens

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public abstract void
addGlobalCondition(Parameter
the parameter
param
,
int
the column index (0 meaning the first column)
columnId
,
int
the comparison type
comparisonType
)

Add a condition to the query.

pack-priv void
addParameter(Parameter
the parameter to add
param
)

Add a parameter to the parameter list.

public abstract boolean

Returns:

true if adding global conditions is allowed
allowGlobalConditions
()

Check whether adding condition to the query is allowed.

pack-priv void
appendEndOfQueryToSQL(StringBuilder
query plan string builder.
builder
,
int
formatting flags
sqlFlags
,
Expression[]
the array of expressions
expressions
)

Appends ORDER BY, OFFSET, and FETCH clauses to the plan.

private static boolean

Returns:

whether the specified expression should be allowed in ORDER BY list of DISTINCT select
checkOrderOther
(SessionLocal
session
session
,
Expression
expression to check
expr
,
ArrayList<String>
SQL of allowed expressions
expressionSQL
)

An additional check for expression in ORDER BY list for DISTINCT selects that was not matched with selected expressions in regular way.

pack-priv void
cleanupOrder()

Removes constant expressions from the sort order.

private void
public void
collectDependencies(HashSet<DbObject>
collection of dependencies to populate
dependencies
)

Overrides org.h2.command.Prepared.collectDependencies.

Find and collect all DbObjects, this Prepared depends on.

pack-priv LocalResult

Returns:

the distinct result
convertToDistinct
(ResultInterface
the source
result
)

Convert a result into a distinct result, using the current columns.

public void
disableCache()

Disable caching of result sets.

private boolean
public final boolean

Returns:

EXISTS predicate result
exists
()

Execute the EXISTS predicate over the query.

pack-priv LocalResult

Returns:

the result or null
finishResult
(LocalResult
the result
result
,
long
OFFSET value
offset
,
long
FETCH value
fetch
,
boolean
whether FETCH value is a PERCENT value
fetchPercent
,
ResultTarget
target result or null
target
)

Applies limits, if any, to a result and makes it ready for value retrieval.

public abstract void
fireBeforeSelectTriggers()

Call the before triggers on all tables.

public int

Returns:

the column count
getColumnCount
()

Get the column count of this query.

public abstract double

Returns:

the cost
getCost
()

Calculate the cost to execute this query.

public int

Returns:

the estimated cost as an integer
getCostAsExpression
()

Calculate the cost when used as a subquery.

public ArrayList<Expression>

Returns:

the list of expressions
getExpressions
()

The the list of select expressions.

public Expression
public ForUpdate

Returns:

FOR UPDATE clause or null
getForUpdate
()

Returns FOR UPDATE clause, if any.

public Expression

Returns:

the expression, or null
getIfSingleRow
()

If this query is determined as a single-row query, returns a replacement expression.

public final long
private boolean
public Expression
pack-priv Query.OffsetFetch

Returns:

the evaluated values
getOffsetFetch
(long
additional limit
maxRows
)

Evaluates OFFSET and FETCH expressions.

public QueryScope

Returns:

the scope of the outer query
getOuterQueryScope
()

Returns the scope of the outer query.

private Value[]
public TypeInfo

Returns:

data type of rows
getRowDataType
()

Returns data type of rows.

public abstract HashSet<Table>

Returns:

the set of tables
getTables
()

Get all tables that are involved in this query.

public int
getType()

Implements abstract org.h2.command.Prepared.getType.

Get the command type as defined in CommandInterface

public boolean

Returns:

true if it has
hasOrder
()

Whether the query has an order.

public abstract void
init()

Initialize the query.

pack-priv int

Returns:

index on the expression in the expressions list.
initExpression
(ArrayList<String>
the select list SQL snippets
expressionSQL
,
Expression
the expression.
e
,
boolean
all order by expressions must be in the select list
mustBeInResult
,
ArrayList<TableFilter>
the table filters.
filters
)

Initialize the 'ORDER BY' or 'DISTINCT' expressions.

pack-priv boolean

Returns:

true if ORDER BY clause is preserved, false otherwise
initOrder
(ArrayList<String>
the select list SQL snippets
expressionSQL
,
boolean
all order by expressions must be in the select list
mustBeInResult
,
ArrayList<TableFilter>
the table filters
filters
)

Initialize the order by list.

public boolean

Returns:

whether this query is a DISTINCT or DISTINCT ON (...) query
isAnyDistinct
()

public boolean

Returns:

if this query will always return the same value and has no side effects.
isConstantQuery
()

Check if this query will always return the same value and has no side effects.

public abstract boolean

Returns:

if the criteria can be fulfilled
isEverything
(ExpressionVisitor
the visitor
visitor
)

Check if this expression and all sub-expressions can fulfill a criteria.

public boolean
public boolean
public boolean
isQuery()

Overrides org.h2.command.Prepared.isQuery.

Check if this object is a query.

public boolean

Returns:

whether results support random access
isRandomAccessResult
()

Returns whether results support random access.

public boolean
isReadOnly()

Overrides org.h2.command.Prepared.isReadOnly.

Check if this command is read only.

public boolean
isRetryable()

Overrides org.h2.command.Prepared.isRetryable.

Returns is this command can be repeated again on locking failure.

public boolean

Returns:

whether this query is a plain DISTINCT query
isStandardDistinct
()

public boolean
isTransactional()

Implements abstract org.h2.command.Prepared.isTransactional.

Check if this command is transactional.

public abstract boolean

Returns:

true if this is a UNION query
isUnion
()

Check if this is a UNION query.

public boolean
public abstract void
mapColumns(ColumnResolver
the resolver
resolver
,
int
the subquery level (0 is the top level query, 1 is the first subquery level)
level
,
boolean
whether this method was called from the outer query
outer
)

Map the columns to the given column resolver.

public final void
prepare()

Overrides org.h2.command.Prepared.prepare.

Prepare this statement.

public abstract void
pack-priv void
prepareOrder(ArrayList<QueryOrderBy>
a list of QueryOrderBy elements
orderList
,
int
the number of columns in the query
expressionCount
)

Create a SortOrder object given the list of QueryOrderBy objects.

public abstract void
public final ResultInterface
query(long
the maximum number of rows to return
maxrows
)

Overrides org.h2.command.Prepared.query.

Execute the query.

public final ResultInterface

Returns:

the result set (if the target is not set).
query
(long
the maximum number of rows to return
limit
,
ResultTarget
the target result (null will return the result)
target
)

Execute the query, writing the result to the target result.

public ResultInterface
queryMeta()

Implements abstract org.h2.command.Prepared.queryMeta.

Get an empty result set containing the meta data.

protected abstract ResultInterface

Returns:

the result
queryWithoutCache
(long
the limit as specified in the JDBC method call
limit
,
ResultTarget
the target to write results to
target
)

Execute the query without checking the cache.

private ResultInterface
private static boolean
sameParameters(Value[] params, Value[] lastParams)

public void
setDistinctIfPossible()

Set the distinct flag only if it is possible, may be used as a possible optimization only.

public abstract void
setEvaluatable(TableFilter
the table filter
tableFilter
,
boolean
the new value
b
)

Change the evaluatable flag.

public void
public void
setFetchPercent(boolean fetchPercent)

public abstract void
setForUpdate(ForUpdate
the new FOR UPDATE clause
forUpdate
)

Set the FOR UPDATE clause.

public void
setNeverLazy(boolean b)

public void
public void
setOrder(ArrayList<QueryOrderBy>
the order by list
order
)

Set the order by list.

public void
setOuterQueryScope(QueryScope
the scope of the outer query
outerQueryScope
)

Sets the scope of the outer query.

public void
setRandomAccessResult(boolean
the new value
b
)

Whether results need to support random access.

public void
setWithClause(LinkedHashMap<String, Table>
the WITH clause of this query
withClause
)

Sets the WITH clause of this query.

public void
setWithTies(boolean withTies)

public Table

Returns:

the table or the view
toTable
(String
alias name for the view
alias
,
Column[]
column templates, or null
columnTemplates
,
ArrayList<Parameter>
the parameters
parameters
,
boolean
if true, a system session will be used for the view
forCreateView
,
Query
the top level query
topQuery
)

Converts this query to a table or a view.

public abstract void
updateAggregate(SessionLocal
the session
s
,
int
select stage
stage
)

Update all aggregate function values.

protected void
writeWithList(StringBuilder builder, int sqlFlags)

Inherited from org.h2.command.Prepared:
checkCanceledcheckParametersgetCurrentRowNumbergetDatabasegetObjectIdgetParametersgetPersistedObjectIdgetPlanSQLgetPlanSQLgetSessiongetSimpleSQLgetSQLgetSQLTokensisCacheableisWithParamValuesneedRecompilesetCommandsetCurrentRowNumbersetParameterListsetPersistedObjectIdsetPrepareAlwayssetRowsetSessionsetSQLsetWithParamValuestoStringupdate

Field Detail

cacheableCheckedback to summary
private boolean cacheableChecked
checkInitback to summary
pack-priv boolean checkInit
distinctback to summary
pack-priv boolean distinct

Whether the result must only contain distinct rows.

expressionArrayback to summary
pack-priv Expression[] expressionArray

Array of expressions.

See Also
expressions
expressionsback to summary
pack-priv ArrayList<Expression> expressions

The column list, including invisible expressions such as order by expressions.

fetchExprback to summary
pack-priv Expression fetchExpr

The fetch expression as specified in the FETCH, LIMIT, or TOP clause.

fetchPercentback to summary
pack-priv boolean fetchPercent

Whether limit expression specifies percentage of rows.

isPreparedback to summary
pack-priv boolean isPrepared
lastEvaluatedback to summary
private long lastEvaluated
lastExistsback to summary
private Boolean lastExists
lastLimitback to summary
private long lastLimit
lastParametersback to summary
private Value[] lastParameters
lastResultback to summary
private ResultInterface lastResult
neverLazyback to summary
private boolean neverLazy
noCacheback to summary
private boolean noCache
offsetExprback to summary
pack-priv Expression offsetExpr

The offset expression as specified in the OFFSET clause.

orderListback to summary
pack-priv ArrayList<QueryOrderBy> orderList

Describes elements of the ORDER BY clause of a query.

outerQueryScopeback to summary
private QueryScope outerQueryScope

The outer scope of this query.

randomAccessResultback to summary
pack-priv boolean randomAccessResult

Whether the result needs to support random access.

resultColumnCountback to summary
pack-priv int resultColumnCount

Number of columns including visible columns and additional virtual columns for ORDER BY and DISTINCT ON clauses. This number does not include virtual columns for HAVING and QUALIFY.

sortback to summary
pack-priv SortOrder sort

A sort order represents an ORDER BY clause in a query.

visibleColumnCountback to summary
pack-priv int visibleColumnCount

The visible columns (the ones required in the result).

withClauseback to summary
private LinkedHashMap<String, Table> withClause

The WITH clause of this query.

withTiesback to summary
pack-priv boolean withTies

Whether tied rows should be included in result too.

Constructor Detail

Queryback to summary
pack-priv Query(SessionLocal session)

Method Detail

addGlobalConditionback to summary
public abstract void addGlobalCondition(Parameter param, int columnId, int comparisonType)

Add a condition to the query. This is used for views.

Parameters
param:Parameter

the parameter

columnId:int

the column index (0 meaning the first column)

comparisonType:int

the comparison type

addParameterback to summary
pack-priv void addParameter(Parameter param)

Add a parameter to the parameter list.

Parameters
param:Parameter

the parameter to add

allowGlobalConditionsback to summary
public abstract boolean allowGlobalConditions()

Check whether adding condition to the query is allowed. This is not allowed for views that have an order by and a limit, as it would affect the returned results.

Returns:boolean

true if adding global conditions is allowed

appendEndOfQueryToSQLback to summary
pack-priv void appendEndOfQueryToSQL(StringBuilder builder, int sqlFlags, Expression[] expressions)

Appends ORDER BY, OFFSET, and FETCH clauses to the plan.

Parameters
builder:StringBuilder

query plan string builder.

sqlFlags:int

formatting flags

expressions:Expression[]

the array of expressions

checkOrderOtherback to summary
private static boolean checkOrderOther(SessionLocal session, Expression expr, ArrayList<String> expressionSQL)

An additional check for expression in ORDER BY list for DISTINCT selects that was not matched with selected expressions in regular way. This method allows expressions based only on selected expressions in different complicated ways with functions, comparisons, or operators.

Parameters
session:SessionLocal

session

expr:Expression

expression to check

expressionSQL:ArrayList<String>

SQL of allowed expressions

Returns:boolean

whether the specified expression should be allowed in ORDER BY list of DISTINCT select

cleanupOrderback to summary
pack-priv void cleanupOrder()

Removes constant expressions from the sort order. Some constants are detected only after optimization of expressions, this method removes them from the sort order only. They are currently preserved in the list of expressions.

closeLastResultback to summary
private void closeLastResult()
collectDependenciesback to summary
public void collectDependencies(HashSet<DbObject> dependencies)

Overrides org.h2.command.Prepared.collectDependencies.

Doc from org.h2.command.Prepared.collectDependencies.

Find and collect all DbObjects, this Prepared depends on.

Parameters
dependencies:HashSet<DbObject>

collection of dependencies to populate

Annotations
@Override
convertToDistinctback to summary
pack-priv LocalResult convertToDistinct(ResultInterface result)

Convert a result into a distinct result, using the current columns.

Parameters
result:ResultInterface

the source

Returns:LocalResult

the distinct result

disableCacheback to summary
public void disableCache()

Disable caching of result sets.

executeExistsback to summary
private boolean executeExists()
existsback to summary
public final boolean exists()

Execute the EXISTS predicate over the query.

Returns:boolean

EXISTS predicate result

finishResultback to summary
pack-priv LocalResult finishResult(LocalResult result, long offset, long fetch, boolean fetchPercent, ResultTarget target)

Applies limits, if any, to a result and makes it ready for value retrieval.

Parameters
result:LocalResult

the result

offset:long

OFFSET value

fetch:long

FETCH value

fetchPercent:boolean

whether FETCH value is a PERCENT value

target:ResultTarget

target result or null

Returns:LocalResult

the result or null

fireBeforeSelectTriggersback to summary
public abstract void fireBeforeSelectTriggers()

Call the before triggers on all tables.

getColumnCountback to summary
public int getColumnCount()

Get the column count of this query.

Returns:int

the column count

getCostback to summary
public abstract double getCost()

Calculate the cost to execute this query.

Returns:double

the cost

getCostAsExpressionback to summary
public int getCostAsExpression()

Calculate the cost when used as a subquery. This method returns a value between 10 and 1000000, to ensure adding other values can't result in an integer overflow.

Returns:int

the estimated cost as an integer

getExpressionsback to summary
public ArrayList<Expression> getExpressions()

The the list of select expressions. This may include invisible expressions such as order by expressions.

Returns:ArrayList<Expression>

the list of expressions

getFetchback to summary
public Expression getFetch()
getForUpdateback to summary
public ForUpdate getForUpdate()

Returns FOR UPDATE clause, if any.

Returns:ForUpdate

FOR UPDATE clause or null

getIfSingleRowback to summary
public Expression getIfSingleRow()

If this query is determined as a single-row query, returns a replacement expression.

Returns:Expression

the expression, or null

getMaxDataModificationIdback to summary
public final long getMaxDataModificationId()
getNoCacheback to summary
private boolean getNoCache()
getOffsetback to summary
public Expression getOffset()
getOffsetFetchback to summary
pack-priv Query.OffsetFetch getOffsetFetch(long maxRows)

Evaluates OFFSET and FETCH expressions.

Parameters
maxRows:long

additional limit

Returns:Query.OffsetFetch

the evaluated values

getOuterQueryScopeback to summary
public QueryScope getOuterQueryScope()

Returns the scope of the outer query.

Returns:QueryScope

the scope of the outer query

getParameterValuesback to summary
private Value[] getParameterValues()
getRowDataTypeback to summary
public TypeInfo getRowDataType()

Returns data type of rows.

Returns:TypeInfo

data type of rows

getTablesback to summary
public abstract HashSet<Table> getTables()

Get all tables that are involved in this query.

Returns:HashSet<Table>

the set of tables

getTypeback to summary
public int getType()

Implements abstract org.h2.command.Prepared.getType.

Doc from org.h2.command.Prepared.getType.

Get the command type as defined in CommandInterface

Returns:int

the statement type

Annotations
@Override
hasOrderback to summary
public boolean hasOrder()

Whether the query has an order.

Returns:boolean

true if it has

initback to summary
public abstract void init()

Initialize the query.

initExpressionback to summary
pack-priv int initExpression(ArrayList<String> expressionSQL, Expression e, boolean mustBeInResult, ArrayList<TableFilter> filters)

Initialize the 'ORDER BY' or 'DISTINCT' expressions.

Parameters
expressionSQL:ArrayList<String>

the select list SQL snippets

e:Expression

the expression.

mustBeInResult:boolean

all order by expressions must be in the select list

filters:ArrayList<TableFilter>

the table filters.

Returns:int

index on the expression in the expressions list.

initOrderback to summary
pack-priv boolean initOrder(ArrayList<String> expressionSQL, boolean mustBeInResult, ArrayList<TableFilter> filters)

Initialize the order by list. This call may extend the expressions list.

Parameters
expressionSQL:ArrayList<String>

the select list SQL snippets

mustBeInResult:boolean

all order by expressions must be in the select list

filters:ArrayList<TableFilter>

the table filters

Returns:boolean

true if ORDER BY clause is preserved, false otherwise

isAnyDistinctback to summary
public boolean isAnyDistinct()
Returns:boolean

whether this query is a DISTINCT or DISTINCT ON (...) query

isConstantQueryback to summary
public boolean isConstantQuery()

Check if this query will always return the same value and has no side effects.

Returns:boolean

if this query will always return the same value and has no side effects.

isEverythingback to summary
public abstract boolean isEverything(ExpressionVisitor visitor)

Check if this expression and all sub-expressions can fulfill a criteria. If any part returns false, the result is false.

Parameters
visitor:ExpressionVisitor

the visitor

Returns:boolean

if the criteria can be fulfilled

isFetchPercentback to summary
public boolean isFetchPercent()
isNeverLazyback to summary
public boolean isNeverLazy()
isQueryback to summary
public boolean isQuery()

Overrides org.h2.command.Prepared.isQuery.

Doc from org.h2.command.Prepared.isQuery.

Check if this object is a query.

Returns:boolean

true if it is

Annotations
@Override
isRandomAccessResultback to summary
public boolean isRandomAccessResult()

Returns whether results support random access.

Returns:boolean

whether results support random access

isReadOnlyback to summary
public boolean isReadOnly()

Overrides org.h2.command.Prepared.isReadOnly.

Doc from org.h2.command.Prepared.isReadOnly.

Check if this command is read only.

Returns:boolean

true if it is

Annotations
@Override
isRetryableback to summary
public boolean isRetryable()

Overrides org.h2.command.Prepared.isRetryable.

Doc from org.h2.command.Prepared.isRetryable.

Returns is this command can be repeated again on locking failure.

Returns:boolean

is this command can be repeated again on locking failure

Annotations
@Override
isStandardDistinctback to summary
public boolean isStandardDistinct()
Returns:boolean

whether this query is a plain DISTINCT query

isTransactionalback to summary
public boolean isTransactional()

Implements abstract org.h2.command.Prepared.isTransactional.

Doc from org.h2.command.Prepared.isTransactional.

Check if this command is transactional. If it is not, then it forces the current transaction to commit.

Returns:boolean

true if it is

Annotations
@Override
isUnionback to summary
public abstract boolean isUnion()

Check if this is a UNION query.

Returns:boolean

true if this is a UNION query

isWithTiesback to summary
public boolean isWithTies()
mapColumnsback to summary
public abstract void mapColumns(ColumnResolver resolver, int level, boolean outer)

Map the columns to the given column resolver.

Parameters
resolver:ColumnResolver

the resolver

level:int

the subquery level (0 is the top level query, 1 is the first subquery level)

outer:boolean

whether this method was called from the outer query

prepareback to summary
public final void prepare()

Overrides org.h2.command.Prepared.prepare.

Doc from org.h2.command.Prepared.prepare.

Prepare this statement.

Annotations
@Override
prepareExpressionsback to summary
public abstract void prepareExpressions()
prepareOrderback to summary
pack-priv void prepareOrder(ArrayList<QueryOrderBy> orderList, int expressionCount)

Create a SortOrder object given the list of QueryOrderBy objects.

Parameters
orderList:ArrayList<QueryOrderBy>

a list of QueryOrderBy elements

expressionCount:int

the number of columns in the query

preparePlanback to summary
public abstract void preparePlan()
queryback to summary
public final ResultInterface query(long maxrows)

Overrides org.h2.command.Prepared.query.

Doc from org.h2.command.Prepared.query.

Execute the query.

Parameters
maxrows:long

the maximum number of rows to return

Returns:ResultInterface

the result set

Annotations
@Override
queryback to summary
public final ResultInterface query(long limit, ResultTarget target)

Execute the query, writing the result to the target result.

Parameters
limit:long

the maximum number of rows to return

target:ResultTarget

the target result (null will return the result)

Returns:ResultInterface

the result set (if the target is not set).

queryMetaback to summary
public ResultInterface queryMeta()

Implements abstract org.h2.command.Prepared.queryMeta.

Doc from org.h2.command.Prepared.queryMeta.

Get an empty result set containing the meta data.

Returns:ResultInterface

the result set

Annotations
@Override
queryWithoutCacheback to summary
protected abstract ResultInterface queryWithoutCache(long limit, ResultTarget target)

Execute the query without checking the cache. If a target is specified, the results are written to it, and the method returns null. If no target is specified, a new LocalResult is created and returned.

Parameters
limit:long

the limit as specified in the JDBC method call

target:ResultTarget

the target to write results to

Returns:ResultInterface

the result

queryWithoutCacheLazyCheckback to summary
private ResultInterface queryWithoutCacheLazyCheck(long limit, ResultTarget target)
sameParametersback to summary
private static boolean sameParameters(Value[] params, Value[] lastParams)
setDistinctIfPossibleback to summary
public void setDistinctIfPossible()

Set the distinct flag only if it is possible, may be used as a possible optimization only.

setEvaluatableback to summary
public abstract void setEvaluatable(TableFilter tableFilter, boolean b)

Change the evaluatable flag. This is used when building the execution plan.

Parameters
tableFilter:TableFilter

the table filter

b:boolean

the new value

setFetchback to summary
public void setFetch(Expression fetch)
setFetchPercentback to summary
public void setFetchPercent(boolean fetchPercent)
setForUpdateback to summary
public abstract void setForUpdate(ForUpdate forUpdate)

Set the FOR UPDATE clause.

Parameters
forUpdate:ForUpdate

the new FOR UPDATE clause

setNeverLazyback to summary
public void setNeverLazy(boolean b)
setOffsetback to summary
public void setOffset(Expression offset)
setOrderback to summary
public void setOrder(ArrayList<QueryOrderBy> order)

Set the order by list.

Parameters
order:ArrayList<QueryOrderBy>

the order by list

setOuterQueryScopeback to summary
public void setOuterQueryScope(QueryScope outerQueryScope)

Sets the scope of the outer query.

Parameters
outerQueryScope:QueryScope

the scope of the outer query

setRandomAccessResultback to summary
public void setRandomAccessResult(boolean b)

Whether results need to support random access.

Parameters
b:boolean

the new value

setWithClauseback to summary
public void setWithClause(LinkedHashMap<String, Table> withClause)

Sets the WITH clause of this query.

Parameters
withClause:LinkedHashMap<String, Table>

the WITH clause of this query

setWithTiesback to summary
public void setWithTies(boolean withTies)
toTableback to summary
public Table toTable(String alias, Column[] columnTemplates, ArrayList<Parameter> parameters, boolean forCreateView, Query topQuery)

Converts this query to a table or a view.

Parameters
alias:String

alias name for the view

columnTemplates:Column[]

column templates, or null

parameters:ArrayList<Parameter>

the parameters

forCreateView:boolean

if true, a system session will be used for the view

topQuery:Query

the top level query

Returns:Table

the table or the view

updateAggregateback to summary
public abstract void updateAggregate(SessionLocal s, int stage)

Update all aggregate function values.

Parameters
s:SessionLocal

the session

stage:int

select stage

writeWithListback to summary
protected void writeWithList(StringBuilder builder, int sqlFlags)
org.h2.command.query back to summary

pack-priv final Class Query.OffsetFetch

extends Object
Class Inheritance

Evaluated values of OFFSET and FETCH clauses.

Field Summary

Modifier and TypeField and Description
pack-priv final long
fetch

FETCH value.

pack-priv final boolean
fetchPercent

Whether FETCH value is a PERCENT value.

pack-priv final long
offset

OFFSET value.

Constructor Summary

AccessConstructor and Description
pack-priv
OffsetFetch(long offset, long fetch, boolean fetchPercent)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fetchback to summary
pack-priv final long fetch

FETCH value.

fetchPercentback to summary
pack-priv final boolean fetchPercent

Whether FETCH value is a PERCENT value.

offsetback to summary
pack-priv final long offset

OFFSET value.

Constructor Detail

OffsetFetchback to summary
pack-priv OffsetFetch(long offset, long fetch, boolean fetchPercent)