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

public Class TableValueConstructor

extends Query
Class Inheritance
Static Imports
org.h2.expression.Expression.WITHOUT_PARENTHESES, org.h2.util.HasSQL.DEFAULT_SQL_FLAGS

Table value constructor.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private TableValueConstructor.TableValueColumnResolver
private double
private final ArrayList<ArrayList<Expression>>
pack-priv TableValueConstructorTable
table

The table.

Inherited from org.h2.command.query.Query:
checkInitdistinctexpressionArrayexpressionsfetchExprfetchPercentisPreparedoffsetExprorderListrandomAccessResultresultColumnCountsortvisibleColumnCountwithTies

Constructor Summary

AccessConstructor and Description
public
TableValueConstructor(SessionLocal
the session
session
,
ArrayList<ArrayList<Expression>>
the rows
rows
)

Creates new instance of table value constructor.

Method Summary

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

Implements abstract org.h2.command.query.Query.addGlobalCondition.

Add a condition to the query.

public boolean
allowGlobalConditions()

Implements abstract org.h2.command.query.Query.allowGlobalConditions.

Check whether adding condition to the query is allowed.

private void
public void
fireBeforeSelectTriggers()

Implements abstract org.h2.command.query.Query.fireBeforeSelectTriggers.

Call the before triggers on all tables.

public double
getCost()

Implements abstract org.h2.command.query.Query.getCost.

Calculate the cost to execute this query.

public Expression
getIfSingleRow()

Overrides org.h2.command.query.Query.getIfSingleRow.

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

public StringBuilder
getPlanSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Overrides org.h2.command.Prepared.getPlanSQL.

Appends the SQL statement with the execution plan.

public HashSet<Table>
getTables()

Implements abstract org.h2.command.query.Query.getTables.

Get all tables that are involved in this query.

public static void
getValuesSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
,
ArrayList<ArrayList<Expression>>
the values
rows
)

Appends the SQL of the values to the specified string builder..

public static void
getVisibleResult(SessionLocal
the session
session
,
ResultTarget
the result
result
,
Column[]
the columns
columns
,
ArrayList<ArrayList<Expression>>
the rows with data
rows
)

Appends visible columns of all rows to the specified result.

public void
init()

Implements abstract org.h2.command.query.Query.init.

Initialize the query.

public boolean
isConstantQuery()

Overrides org.h2.command.query.Query.isConstantQuery.

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

public boolean
isEverything(ExpressionVisitor
the visitor
visitor
)

Implements abstract org.h2.command.query.Query.isEverything.

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

public boolean
isUnion()

Implements abstract org.h2.command.query.Query.isUnion.

Check if this is a UNION query.

public 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
)

Implements abstract org.h2.command.query.Query.mapColumns.

Map the columns to the given column resolver.

public void
public void
protected ResultInterface
queryWithoutCache(long
the limit as specified in the JDBC method call
limit
,
ResultTarget
the target to write results to
target
)

Implements abstract org.h2.command.query.Query.queryWithoutCache.

Execute the query without checking the cache.

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

Implements abstract org.h2.command.query.Query.setEvaluatable.

Change the evaluatable flag.

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

Implements abstract org.h2.command.query.Query.setForUpdate.

Set the FOR UPDATE clause.

public Table
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
)

Overrides org.h2.command.query.Query.toTable.

Converts this query to a table or a view.

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

Implements abstract org.h2.command.query.Query.updateAggregate.

Update all aggregate function values.

Inherited from org.h2.command.query.Query:
addParameterappendEndOfQueryToSQLcleanupOrdercollectDependenciesconvertToDistinctdisableCacheexistsfinishResultgetColumnCountgetCostAsExpressiongetExpressionsgetFetchgetForUpdategetMaxDataModificationIdgetOffsetgetOffsetFetchgetOuterQueryScopegetRowDataTypegetTypehasOrderinitExpressioninitOrderisAnyDistinctisFetchPercentisNeverLazyisQueryisRandomAccessResultisReadOnlyisRetryableisStandardDistinctisTransactionalisWithTiesprepareprepareOrderqueryqueryqueryMetasetDistinctIfPossiblesetFetchsetFetchPercentsetNeverLazysetOffsetsetOrdersetOuterQueryScopesetRandomAccessResultsetWithClausesetWithTieswriteWithList

Field Detail

columnResolverback to summary
private TableValueConstructor.TableValueColumnResolver columnResolver
costback to summary
private double cost
rowsback to summary
private final ArrayList<ArrayList<Expression>> rows
tableback to summary
pack-priv TableValueConstructorTable table

The table.

Constructor Detail

TableValueConstructorback to summary
public TableValueConstructor(SessionLocal session, ArrayList<ArrayList<Expression>> rows)

Creates new instance of table value constructor.

Parameters
session:SessionLocal

the session

rows:ArrayList<ArrayList<Expression>>

the rows

Method Detail

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

Implements abstract org.h2.command.query.Query.addGlobalCondition.

Doc from org.h2.command.query.Query.addGlobalCondition.

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

Annotations
@Override
allowGlobalConditionsback to summary
public boolean allowGlobalConditions()

Implements abstract org.h2.command.query.Query.allowGlobalConditions.

Doc from org.h2.command.query.Query.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

Annotations
@Override
createTableback to summary
private void createTable()
fireBeforeSelectTriggersback to summary
public void fireBeforeSelectTriggers()

Implements abstract org.h2.command.query.Query.fireBeforeSelectTriggers.

Doc from org.h2.command.query.Query.fireBeforeSelectTriggers.

Call the before triggers on all tables.

Annotations
@Override
getCostback to summary
public double getCost()

Implements abstract org.h2.command.query.Query.getCost.

Doc from org.h2.command.query.Query.getCost.

Calculate the cost to execute this query.

Returns:double

the cost

Annotations
@Override
getIfSingleRowback to summary
public Expression getIfSingleRow()

Overrides org.h2.command.query.Query.getIfSingleRow.

Doc from org.h2.command.query.Query.getIfSingleRow.

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

Returns:Expression

the expression, or null

Annotations
@Override
getPlanSQLback to summary
public StringBuilder getPlanSQL(StringBuilder builder, int sqlFlags)

Overrides org.h2.command.Prepared.getPlanSQL.

Doc from org.h2.command.Prepared.getPlanSQL.

Appends the SQL statement with the execution plan.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the execution plan

Annotations
@Override
getTablesback to summary
public HashSet<Table> getTables()

Implements abstract org.h2.command.query.Query.getTables.

Doc from org.h2.command.query.Query.getTables.

Get all tables that are involved in this query.

Returns:HashSet<Table>

the set of tables

Annotations
@Override
getValuesSQLback to summary
public static void getValuesSQL(StringBuilder builder, int sqlFlags, ArrayList<ArrayList<Expression>> rows)

Appends the SQL of the values to the specified string builder..

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

rows:ArrayList<ArrayList<Expression>>

the values

getVisibleResultback to summary
public static void getVisibleResult(SessionLocal session, ResultTarget result, Column[] columns, ArrayList<ArrayList<Expression>> rows)

Appends visible columns of all rows to the specified result.

Parameters
session:SessionLocal

the session

result:ResultTarget

the result

columns:Column[]

the columns

rows:ArrayList<ArrayList<Expression>>

the rows with data

initback to summary
public void init()

Implements abstract org.h2.command.query.Query.init.

Doc from org.h2.command.query.Query.init.

Initialize the query.

Annotations
@Override
isConstantQueryback to summary
public boolean isConstantQuery()

Overrides org.h2.command.query.Query.isConstantQuery.

Doc from org.h2.command.query.Query.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.

Annotations
@Override
isEverythingback to summary
public boolean isEverything(ExpressionVisitor visitor)

Implements abstract org.h2.command.query.Query.isEverything.

Doc from org.h2.command.query.Query.isEverything.

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

Annotations
@Override
isUnionback to summary
public boolean isUnion()

Implements abstract org.h2.command.query.Query.isUnion.

Doc from org.h2.command.query.Query.isUnion.

Check if this is a UNION query.

Returns:boolean

true if this is a UNION query

Annotations
@Override
mapColumnsback to summary
public void mapColumns(ColumnResolver resolver, int level, boolean outer)

Implements abstract org.h2.command.query.Query.mapColumns.

Doc from org.h2.command.query.Query.mapColumns.

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

Annotations
@Override
prepareExpressionsback to summary
public void prepareExpressions()

Implements abstract org.h2.command.query.Query.prepareExpressions.

Annotations
@Override
preparePlanback to summary
public void preparePlan()

Implements abstract org.h2.command.query.Query.preparePlan.

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

Implements abstract org.h2.command.query.Query.queryWithoutCache.

Doc from org.h2.command.query.Query.queryWithoutCache.

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

Annotations
@Override
setEvaluatableback to summary
public void setEvaluatable(TableFilter tableFilter, boolean b)

Implements abstract org.h2.command.query.Query.setEvaluatable.

Doc from org.h2.command.query.Query.setEvaluatable.

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

Parameters
tableFilter:TableFilter

the table filter

b:boolean

the new value

Annotations
@Override
setForUpdateback to summary
public void setForUpdate(ForUpdate forUpdate)

Implements abstract org.h2.command.query.Query.setForUpdate.

Doc from org.h2.command.query.Query.setForUpdate.

Set the FOR UPDATE clause.

Parameters
forUpdate:ForUpdate

the new FOR UPDATE clause

Annotations
@Override
toTableback to summary
public Table toTable(String alias, Column[] columnTemplates, ArrayList<Parameter> parameters, boolean forCreateView, Query topQuery)

Overrides org.h2.command.query.Query.toTable.

Doc from org.h2.command.query.Query.toTable.

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

Annotations
@Override
updateAggregateback to summary
public void updateAggregate(SessionLocal s, int stage)

Implements abstract org.h2.command.query.Query.updateAggregate.

Doc from org.h2.command.query.Query.updateAggregate.

Update all aggregate function values.

Parameters
s:SessionLocal

the session

stage:int

select stage

Annotations
@Override
org.h2.command.query back to summary

private final Class TableValueConstructor.TableValueColumnResolver

extends Object
implements ColumnResolver
Class Inheritance
  • java.lang.Object
  • org.h2.command.query.TableValueConstructor.TableValueColumnResolver
All Implemented Interfaces
org.h2.table.ColumnResolver

Field Summary

Modifier and TypeField and Description
pack-priv Value[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Column
findColumn(String
the column name, must be a derived name if this column resolver has a derived column list
name
)

Implements org.h2.table.ColumnResolver.findColumn.

Get the column with the specified name.

public Column[]
getColumns()

Implements org.h2.table.ColumnResolver.getColumns.

Get the column list.

public Value
getValue(Column
the column
column
)

Implements org.h2.table.ColumnResolver.getValue.

Get the value for the given column.

public Expression
optimize(ExpressionColumn
the expression column
expressionColumn
,
Column
the column
column
)

Overrides default org.h2.table.ColumnResolver.optimize.

Get the expression that represents this column.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentRowback to summary
pack-priv Value[] currentRow

Constructor Detail

TableValueColumnResolverback to summary
pack-priv TableValueColumnResolver()

Method Detail

findColumnback to summary
public Column findColumn(String name)

Implements org.h2.table.ColumnResolver.findColumn.

Doc from org.h2.table.ColumnResolver.findColumn.

Get the column with the specified name.

Parameters
name:String

the column name, must be a derived name if this column resolver has a derived column list

Returns:Column

the column with the specified name, or null

Annotations
@Override
getColumnsback to summary
public Column[] getColumns()

Implements org.h2.table.ColumnResolver.getColumns.

Doc from org.h2.table.ColumnResolver.getColumns.

Get the column list.

Returns:Column[]

the column list

Annotations
@Override
getValueback to summary
public Value getValue(Column column)

Implements org.h2.table.ColumnResolver.getValue.

Doc from org.h2.table.ColumnResolver.getValue.

Get the value for the given column.

Parameters
column:Column

the column

Returns:Value

the value

Annotations
@Override
optimizeback to summary
public Expression optimize(ExpressionColumn expressionColumn, Column column)

Overrides default org.h2.table.ColumnResolver.optimize.

Doc from org.h2.table.ColumnResolver.optimize.

Get the expression that represents this column.

Parameters
expressionColumn:ExpressionColumn

the expression column

column:Column

the column

Returns:Expression

the optimized expression

Annotations
@Override