public abstract class Expression extends Object
Constructor and Description |
---|
Expression() |
Modifier and Type | Method and Description |
---|---|
void |
addFilterConditions(TableFilter filter,
boolean outerJoin)
Add conditions to a table filter if they can be evaluated.
|
void |
createIndexConditions(Session session,
TableFilter filter)
Create index conditions if possible and attach them to the table filter.
|
String |
getAlias()
Get the alias name of a column or SQL expression
if it is not an aliased expression.
|
Boolean |
getBooleanValue(Session session)
Get the value in form of a boolean expression.
|
String |
getColumnName()
Get the column name or alias name of this expression.
|
abstract int |
getCost()
Estimate the cost to process the expression.
|
abstract int |
getDisplaySize()
Get the display size of this expression.
|
Expression[] |
getExpressionColumns(Session session)
If this expression consists of column expressions it should return them.
|
static Expression[] |
getExpressionColumns(Session session,
ResultSet rs)
Extracts expression columns from the given result set.
|
Expression |
getNonAliasExpression()
Returns the main expression, skipping aliases.
|
Expression |
getNotIfPossible(Session session)
If it is possible, return the negated expression.
|
int |
getNullable()
Check whether this expression is a column and can store NULL.
|
abstract long |
getPrecision()
Get the precision of this expression.
|
abstract int |
getScale()
Get the scale of this expression.
|
String |
getSchemaName()
Get the schema name, or null
|
abstract String |
getSQL()
Get the SQL statement of this expression.
|
String |
getTableAlias()
Get the table alias name or null
if this expression does not represent a column.
|
String |
getTableName()
Get the table name, or null
|
abstract int |
getType()
Return the data type.
|
abstract Value |
getValue(Session session)
Return the resulting value for the current row.
|
boolean |
isAutoIncrement()
Check if this is an auto-increment column.
|
boolean |
isConstant()
Check if this expression will always return the same value.
|
abstract boolean |
isEverything(ExpressionVisitor visitor)
Check if this expression and all sub-expressions can fulfill a criteria.
|
boolean |
isValueSet()
Is the value of a parameter set.
|
boolean |
isWildcard()
Only returns true if the expression is a wildcard.
|
abstract void |
mapColumns(ColumnResolver resolver,
int level)
Map the columns of the resolver to expression columns.
|
abstract Expression |
optimize(Session session)
Try to optimize the expression.
|
abstract void |
setEvaluatable(TableFilter tableFilter,
boolean value)
Tell the expression columns whether the table filter can return values now.
|
String |
toString()
Convert this expression to a String.
|
abstract void |
updateAggregate(Session session)
Update an aggregate value.
|
public abstract Value getValue(Session session)
session
- the sessionpublic abstract int getType()
public abstract void mapColumns(ColumnResolver resolver, int level)
resolver
- the column resolverlevel
- the subquery nesting levelpublic abstract Expression optimize(Session session)
session
- the sessionpublic abstract void setEvaluatable(TableFilter tableFilter, boolean value)
tableFilter
- the table filtervalue
- true if the table filter can return valuepublic abstract int getScale()
public abstract long getPrecision()
public abstract int getDisplaySize()
public abstract String getSQL()
public abstract void updateAggregate(Session session)
session
- the sessionpublic abstract boolean isEverything(ExpressionVisitor visitor)
visitor
- the visitorpublic abstract int getCost()
public Expression getNotIfPossible(Session session)
session
- the sessionpublic boolean isConstant()
public boolean isValueSet()
public boolean isAutoIncrement()
public Boolean getBooleanValue(Session session)
session
- the sessionpublic void createIndexConditions(Session session, TableFilter filter)
session
- the sessionfilter
- the table filterpublic String getColumnName()
public String getSchemaName()
public String getTableName()
public int getNullable()
public String getTableAlias()
public String getAlias()
public boolean isWildcard()
public Expression getNonAliasExpression()
public void addFilterConditions(TableFilter filter, boolean outerJoin)
filter
- the table filterouterJoin
- if the expression is part of an outer joinpublic String toString()
public Expression[] getExpressionColumns(Session session)
session
- the sessionpublic static Expression[] getExpressionColumns(Session session, ResultSet rs)
session
- the sessionrs
- the result setCopyright © 2012 JBoss by Red Hat. All Rights Reserved.