org.h2.expression
Class TableFunction

java.lang.Object
  extended by org.h2.expression.Expression
      extended by org.h2.expression.Function
          extended by org.h2.expression.TableFunction
All Implemented Interfaces:
FunctionCall

public class TableFunction
extends Function

Implementation of the functions TABLE(..) and TABLE_DISTINCT(..).


Field Summary
 
Fields inherited from class org.h2.expression.Function
ABS, ACOS, args, ARRAY_GET, ARRAY_LENGTH, ASCII, ASIN, ATAN, ATAN2, AUTOCOMMIT, BIT_LENGTH, BITAND, BITOR, BITXOR, CANCEL_SESSION, CASE, CASEWHEN, CAST, CEILING, CHAR, CHAR_LENGTH, COALESCE, COMPRESS, CONCAT, CONVERT, COS, COT, CSVREAD, CSVWRITE, CURDATE, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER, CURRVAL, CURTIME, DATABASE, DATABASE_PATH, DATE_ADD, DATE_DIFF, DAY_NAME, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_YEAR, DECRYPT, DEGREES, DIFFERENCE, ENCRYPT, EXP, EXPAND, EXTRACT, FILE_READ, FLOOR, FORMATDATETIME, GREATEST, HASH, HEXTORAW, HOUR, IDENTITY, IFNULL, INSERT, INSTR, ISO_DAY_OF_WEEK, ISO_WEEK, ISO_YEAR, LCASE, LEAST, LEFT, LENGTH, LINK_SCHEMA, LOCATE, LOCK_MODE, LOCK_TIMEOUT, LOG, LOG10, LOWER, LPAD, LTRIM, MEMORY_FREE, MEMORY_USED, MINUTE, MOD, MONTH, MONTH_NAME, NEXTVAL, NOW, NULLIF, OCTET_LENGTH, PARSEDATETIME, PI, POSITION, POWER, QUARTER, RADIANS, RAND, RANDOM_UUID, RAWTOHEX, READONLY, REGEXP_REPLACE, REPEAT, REPLACE, RIGHT, ROUND, ROUNDMAGIC, RPAD, RTRIM, SCHEMA, SCOPE_IDENTITY, SECOND, SECURE_RAND, SESSION_ID, SET, SIGN, SIN, SOUNDEX, SPACE, SQRT, STRINGDECODE, STRINGENCODE, STRINGTOUTF8, SUBSTR, SUBSTRING, TABLE, TABLE_DISTINCT, TAN, TRANSACTION_ID, TRIM, TRUNCATE, UCASE, UPPER, USER, UTF8TOSTRING, WEEK, XMLATTR, XMLCDATA, XMLCOMMENT, XMLNODE, XMLSTARTDOC, XMLTEXT, YEAR, ZERO
 
Method Summary
protected  void checkParameterCount(int len)
          Check if the parameter count is correct.
 Expression[] getExpressionColumns(Session session)
          If this expression consists of column expressions it should return them.
 java.lang.String getName()
          Get the name of the function.
 long getRowCount()
           
 java.lang.String getSQL()
          Get the SQL statement of this expression.
 Value getValue(Session session)
          Return the resulting value for the current row.
 ValueResultSet getValueForColumnList(Session session, Expression[] nullArgs)
          Get an empty result set with the column names set.
 void setColumns(java.util.ArrayList<Column> columns)
           
 
Methods inherited from class org.h2.expression.Function
doneWithParameters, getArgs, getCost, getDisplaySize, getFunction, getFunctionInfo, getFunctionType, getParameterCount, getPrecision, getScale, getType, isDatePart, isDeterministic, isEverything, mapColumns, optimize, setDataType, setDataType, setEvaluatable, setParameter, updateAggregate
 
Methods inherited from class org.h2.expression.Expression
addFilterConditions, createIndexConditions, getAlias, getBooleanValue, getColumnName, getExpressionColumns, getExpressionColumns, getNonAliasExpression, getNotIfPossible, getNullable, getSchemaName, getTableAlias, getTableName, isAutoIncrement, isConstant, isEverything, isValueSet, isWildcard, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getValue

public Value getValue(Session session)
Description copied from class: Expression
Return the resulting value for the current row.

Specified by:
getValue in interface FunctionCall
Overrides:
getValue in class Function
Parameters:
session - the session
Returns:
the result

checkParameterCount

protected void checkParameterCount(int len)
Description copied from class: Function
Check if the parameter count is correct.

Overrides:
checkParameterCount in class Function
Parameters:
len - the number of parameters set

getSQL

public java.lang.String getSQL()
Description copied from class: Expression
Get the SQL statement of this expression. This may not always be the original SQL statement, specially after optimization.

Specified by:
getSQL in interface FunctionCall
Overrides:
getSQL in class Function
Returns:
the SQL statement

getName

public java.lang.String getName()
Description copied from interface: FunctionCall
Get the name of the function.

Specified by:
getName in interface FunctionCall
Overrides:
getName in class Function
Returns:
the name

getValueForColumnList

public ValueResultSet getValueForColumnList(Session session,
                                            Expression[] nullArgs)
Description copied from interface: FunctionCall
Get an empty result set with the column names set.

Specified by:
getValueForColumnList in interface FunctionCall
Overrides:
getValueForColumnList in class Function
Parameters:
session - the session
nullArgs - the argument list (some arguments may be null)
Returns:
the empty result set

setColumns

public void setColumns(java.util.ArrayList<Column> columns)

getRowCount

public long getRowCount()

getExpressionColumns

public Expression[] getExpressionColumns(Session session)
Description copied from class: Expression
If this expression consists of column expressions it should return them.

Overrides:
getExpressionColumns in class Expression
Parameters:
session - the session
Returns:
array of expression columns if applicable, null otherwise