| java.lang.Object org.h2.expression.Expression
All known Subclasses: org.h2.expression.Parameter, org.h2.expression.Wildcard, org.h2.expression.Variable, org.h2.expression.Rownum, org.h2.expression.Subquery, org.h2.expression.ExpressionList, org.h2.expression.ValueExpression, org.h2.expression.Operation, org.h2.expression.JavaAggregate, org.h2.expression.Condition, org.h2.expression.ExpressionColumn, org.h2.expression.Function, org.h2.expression.Aggregate, org.h2.expression.Alias, org.h2.expression.SequenceValue, org.h2.expression.JavaFunction,
Expression | abstract public class Expression (Code) | | An expression is a operation, a value, or a function in a query.
|
addFilterConditions | public void addFilterConditions(TableFilter filter, boolean outerJoin)(Code) | | Add conditions to a table filter if they can be evaluated.
Parameters: filter - the table filter Parameters: outerJoin - if the expression is part of an outer join |
createIndexConditions | public void createIndexConditions(Session session, TableFilter filter) throws SQLException(Code) | | Create index conditions if possible and attach them to the table filter.
Parameters: session - the session Parameters: filter - the table filter |
getAlias | public String getAlias()(Code) | | Get the alias name of a column or SQL expression
if it is not an aliased expression.
the alias name |
getBooleanValue | public Boolean getBooleanValue(Session session) throws SQLException(Code) | | Get the value in form of a boolean expression.
Returns true, false, or null.
In this database, everything can be a condition.
Parameters: session - the session the result |
getColumnName | public String getColumnName()(Code) | | Get the column name or alias name of this expression.
the column name |
getCost | abstract public int getCost()(Code) | | Estimate the cost to process the expression.
Used when optimizing the query, to calculate the query plan
with the lowest estimated cost.
the estimated cost |
getDisplaySize | abstract public int getDisplaySize()(Code) | | Get the display size of this expression.
the display size |
getNonAliasExpression | public Expression getNonAliasExpression()(Code) | | Returns the main expression, skipping aliases.
the expression |
getNotIfPossible | public Expression getNotIfPossible(Session session)(Code) | | If it is possible, return the negated expression. This is used
to optimize NOT expressions: NOT ID>10 can be converted to
ID<=10. Returns null if negating is not possible.
Parameters: session - the session the negated expression, or null |
getNullable | public int getNullable()(Code) | | Check whether this expression is a column and can store null values.
whether null values are allowed |
getPrecision | abstract public long getPrecision()(Code) | | Get the precision of this expression.
the precision |
getSQL | abstract public String getSQL()(Code) | | Get the SQL statement of this expression.
This may not always be the original SQL statement,
specially after optimization.
the SQL statement |
getScale | abstract public int getScale()(Code) | | Get the scale of this expression.
the scale |
getSchemaName | public String getSchemaName()(Code) | | Get the schema name, or null
the schema name |
getTableAlias | public String getTableAlias()(Code) | | Get the table alias name or null
if this expression does not represent a column.
the table alias name |
getTableName | public String getTableName()(Code) | | Get the table name, or null
the table name |
getType | abstract public int getType()(Code) | | Return the data type. The data type may not be known before the
optimization phase.
the type |
getValue | abstract public Value getValue(Session session) throws SQLException(Code) | | Return the resulting value for the current row.
Parameters: session - the session the result |
isAutoIncrement | public boolean isAutoIncrement()(Code) | | Check if this is an auto-increment column.
true if it is an auto-increment column |
isConstant | public boolean isConstant()(Code) | | Check if this expression will always return the same value.
if the expression is constant |
isEverything | abstract public boolean isEverything(ExpressionVisitor visitor)(Code) | | Check if this expression and all sub-expressions can fulfill a criteria.
If any part returns false, the result is false.
Parameters: visitor - the visitor if the criteria can be fulfilled |
isEverything | final public boolean isEverything(int expressionVisitorType)(Code) | | Check if this expression and all sub-expressions can fulfill a criteria.
This is a convenience function.
Parameters: expressionVisitorType - the visitor type if the criteria can be fulfilled |
isValueSet | public boolean isValueSet()(Code) | | Is the value of a parameter set.
if it is set |
isWildcard | public boolean isWildcard()(Code) | | Only returns true if the expression is a wildcard.
if this expression is a wildcard |
mapColumns | abstract public void mapColumns(ColumnResolver resolver, int level) throws SQLException(Code) | | Map the columns of the resolver to expression columns.
Parameters: resolver - the column resolver Parameters: level - the subquery nesting level |
optimize | abstract public Expression optimize(Session session) throws SQLException(Code) | | Try to optimize the expression.
Parameters: session - the session the optimized expression |
optimizeInJoin | public Expression optimizeInJoin(Session session, Select select) throws SQLException(Code) | | Optimize IN(...) expressions if possible.
Parameters: session - the session Parameters: select - the query the optimized expression |
setEvaluatable | abstract public void setEvaluatable(TableFilter tableFilter, boolean value)(Code) | | Tell the expression columns whether the table filter can return values now.
This is used when optimizing the query.
Parameters: tableFilter - the table filter Parameters: value - true if the table filter can return value |
toString | public String toString()(Code) | | Convert this expression to a String.
the string representation |
updateAggregate | abstract public void updateAggregate(Session session) throws SQLException(Code) | | Update an aggregate value.
This method is called at statement execution time once for each row.
Parameters: session - the session |
|
|