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

public Class SelectListColumnResolver

extends Object
implements ColumnResolver
Class Inheritance
All Implemented Interfaces
org.h2.table.ColumnResolver
Imports
java.util.ArrayList, org.h2.engine.Database, .SessionLocal, org.h2.expression.Expression, .ExpressionColumn, org.h2.table.Column, .ColumnResolver, org.h2.value.TypeInfo, .Value

This class represents a column resolver for the column list of a SELECT statement. It is used to resolve select column aliases in the HAVING clause. Example:

SELECT X/3 AS A, COUNT(*) FROM SYSTEM_RANGE(1, 10) GROUP BY A HAVING A > 2;

Author
Thomas Mueller

Field Summary

Modifier and TypeField and Description
private final Column[]
private final Expression[]
private final Select

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 Select
getSelect()

Overrides default org.h2.table.ColumnResolver.getSelect.

Get the select statement.

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

columnsback to summary
private final Column[] columns
expressionsback to summary
private final Expression[] expressions
selectback to summary
private final Select select

Constructor Detail

SelectListColumnResolverback to summary
pack-priv SelectListColumnResolver(Select select)

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
getSelectback to summary
public Select getSelect()

Overrides default org.h2.table.ColumnResolver.getSelect.

Doc from org.h2.table.ColumnResolver.getSelect.

Get the select statement.

Returns:Select

the select statement

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