org.h2.command.dml
Class SelectListColumnResolver

java.lang.Object
  extended by org.h2.command.dml.SelectListColumnResolver
All Implemented Interfaces:
ColumnResolver

public class SelectListColumnResolver
extends java.lang.Object
implements ColumnResolver

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

Method Summary
 Column[] getColumns()
          Get the column list.
 java.lang.String getSchemaName()
          Get the schema name.
 Select getSelect()
          Get the select statement.
 Column[] getSystemColumns()
          Get the list of system columns, if any.
 java.lang.String getTableAlias()
          Get the table alias.
 TableFilter getTableFilter()
          Get the table filter.
 Value getValue(Column column)
          Get the value for the given column.
 Expression optimize(ExpressionColumn expressionColumn, Column column)
          Get the expression that represents this column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getColumns

public Column[] getColumns()
Description copied from interface: ColumnResolver
Get the column list.

Specified by:
getColumns in interface ColumnResolver
Returns:
the column list

getSchemaName

public java.lang.String getSchemaName()
Description copied from interface: ColumnResolver
Get the schema name.

Specified by:
getSchemaName in interface ColumnResolver
Returns:
the schema name

getSelect

public Select getSelect()
Description copied from interface: ColumnResolver
Get the select statement.

Specified by:
getSelect in interface ColumnResolver
Returns:
the select statement

getSystemColumns

public Column[] getSystemColumns()
Description copied from interface: ColumnResolver
Get the list of system columns, if any.

Specified by:
getSystemColumns in interface ColumnResolver
Returns:
the system columns

getTableAlias

public java.lang.String getTableAlias()
Description copied from interface: ColumnResolver
Get the table alias.

Specified by:
getTableAlias in interface ColumnResolver
Returns:
the table alias

getTableFilter

public TableFilter getTableFilter()
Description copied from interface: ColumnResolver
Get the table filter.

Specified by:
getTableFilter in interface ColumnResolver
Returns:
the table filter

getValue

public Value getValue(Column column)
Description copied from interface: ColumnResolver
Get the value for the given column.

Specified by:
getValue in interface ColumnResolver
Parameters:
column - the column
Returns:
the value

optimize

public Expression optimize(ExpressionColumn expressionColumn,
                           Column column)
Description copied from interface: ColumnResolver
Get the expression that represents this column.

Specified by:
optimize in interface ColumnResolver
Parameters:
expressionColumn - the expression column
column - the column
Returns:
the optimized expression