| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| public static final int | AUTO_PARENTHESES
Wrap expression in parentheses only if it can't be safely included into other expressions without them. |
| public static final int | MAP_IN_AGGREGATE
State for expressions inside an aggregate for
|
| public static final int | MAP_IN_WINDOW
State for expressions inside a window function for
|
| public static final int | MAP_INITIAL
Initial state for |
| public static final int | WITH_PARENTHESES
Wrap expression in parentheses unconditionally. |
| public static final int | WITHOUT_PARENTHESES
Do not wrap expression in parentheses. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addFilterConditions(TableFilter
the table filter filter)Add conditions to a table filter if they can be evaluated. |
| public void | createIndexConditions(SessionLocal
the session session, TableFilter the table filter filter)Create index conditions if possible and attach them to the table filter. |
| public String | Returns: the alias namethe session session, int 0-based column index columnIndex)Get the alias name of a column or SQL expression if it is not an aliased expression. |
| public boolean | Returns: the resultthe session session)Get the value in form of a boolean expression. |
| public String | Returns: the column namethe session session, int 0-based column index columnIndex)Get the column name or alias name of this expression. |
| public String | Returns: the column name for a viewthe session session, int 0-based column index columnIndex)Get the column name of this expression for a view. |
| public abstract int | |
| public final StringBuilder | Returns: the specified string builderstring builder builder, int formatting flags sqlFlags)Get the SQL statement of this expression. |
| public Expression | |
| public Expression | Returns: the negated expression, or nullthe session session)If it is possible, return the negated expression. |
| public int | Returns: whether NULL is allowedCheck whether this expression is a column and can store NULL. |
| public String | |
| public final String | getSQL(int
formatting flags sqlFlags)Overrides default org. Get the SQL statement of this expression. |
| public final StringBuilder | getSQL(StringBuilder
string builder builder, int formatting flags sqlFlags)Implements org. Appends the SQL statement of this object to the specified builder. |
| public final String | Returns: the SQL statementformatting flags sqlFlags, int parentheses mode parentheses)Get the SQL statement of this expression. |
| public final StringBuilder | Returns: the specified string builderstring builder builder, int formatting flags sqlFlags, int parentheses mode parentheses)Get the SQL statement of this expression. |
| public Expression | Returns: subexpression with specified index, may be null0-based index index)Returns subexpression with specified index. |
| public int | |
| public String | Returns: the table alias nameGet the table alias name or null if this expression does not represent a column. |
| public String | |
| public abstract TypeInfo | |
| public TypeInfo | Returns: data type ornullthe session session)Returns data type of this expression if it is statically known. |
| public abstract StringBuilder | Returns: the specified string builderstring builder builder, int formatting flags sqlFlags)Get the SQL statement of this expression. |
| public abstract Value | Returns: the resultthe session session)Return the resulting value for the current row. |
| public StringBuilder | Returns: the specified string builderstring builder builder, int formatting flags sqlFlags)Appends the SQL statement of this when operand to the specified builder. |
| public boolean | Returns: the resultthe session session, Value value on the left side left)Return the resulting value of when operand for the current row. |
| public boolean | Returns: if the expression is constantCheck if this expression will always return the same value. |
| public abstract boolean | Returns: if the criteria can be fulfilledthe visitor visitor)Check if this expression and all sub-expressions can fulfill a criteria. |
| public boolean | |
| public boolean | Returns: if the expression is constant NULL valueCheck if this expression will always return the NULL value. |
| public boolean | |
| public boolean | Returns: true if it is, false otherwiseReturns whether this expression is a right side of condition in a when operand. |
| public abstract void | mapColumns(ColumnResolver
the column resolver resolver, int the subquery nesting level level, int current state for nesting checks, initial value is
state)MAP_INITIALMap the columns of the resolver to expression columns. |
| public boolean | Returns: true if it isReturns whether this expressions needs to be wrapped in parentheses when it is used as an argument of other expressions. |
| public abstract Expression | Returns: the optimized expressionthe session session)Try to optimize the expression. |
| public final Expression | Returns: the optimized condition, ornullthe session session)Try to optimize or remove the condition. |
| public abstract void | setEvaluatable(TableFilter
the table filter tableFilter, boolean true if the table filter can return value value)Tell the expression columns whether the table filter can return values now. |
| public String | Returns: the string representationOverrides java. Convert this expression to a String. |
| public abstract void | |
| public static StringBuilder | Returns: the specified string builderthe builder to append the SQL to builder, List<? extends Expression> the list of expressions expressions, int formatting flags sqlFlags)Get the SQL snippet for a list of expressions. |
| public static StringBuilder | Returns: the specified string builderthe builder to append the SQL to builder, Expression[] the list of expressions expressions, int formatting flags sqlFlags)Get the SQL snippet for an array of expressions. |
| addedToFilter | back to summary |
|---|---|
| private boolean addedToFilter | |
| AUTO_PARENTHESES | back to summary |
|---|---|
| public static final int AUTO_PARENTHESES Wrap expression in parentheses only if it can't be safely included into other expressions without them. | |
| MAP_IN_AGGREGATE | back to summary |
|---|---|
| public static final int MAP_IN_AGGREGATE State for expressions inside an aggregate for
| |
| MAP_IN_WINDOW | back to summary |
|---|---|
| public static final int MAP_IN_WINDOW State for expressions inside a window function for
| |
| MAP_INITIAL | back to summary |
|---|---|
| public static final int MAP_INITIAL Initial state for | |
| WITH_PARENTHESES | back to summary |
|---|---|
| public static final int WITH_PARENTHESES Wrap expression in parentheses unconditionally. | |
| WITHOUT_PARENTHESES | back to summary |
|---|---|
| public static final int WITHOUT_PARENTHESES Do not wrap expression in parentheses. | |
| Expression | back to summary |
|---|---|
| public Expression() | |
| addFilterConditions | back to summary |
|---|---|
| public void addFilterConditions(TableFilter filter) Add conditions to a table filter if they can be evaluated.
| |
| createIndexConditions | back to summary |
|---|---|
| public void createIndexConditions(SessionLocal session, TableFilter filter) Create index conditions if possible and attach them to the table filter.
| |
| getAlias | back to summary |
|---|---|
| public String getAlias(SessionLocal session, int columnIndex) Get the alias name of a column or SQL expression if it is not an aliased expression.
| |
| getBooleanValue | back to summary |
|---|---|
| public boolean getBooleanValue(SessionLocal session) Get the value in form of a boolean expression. Returns true or false. In this database, everything can be a condition.
| |
| getColumnName | back to summary |
|---|---|
| public String getColumnName(SessionLocal session, int columnIndex) Get the column name or alias name of this expression.
| |
| getColumnNameForView | back to summary |
|---|---|
| public String getColumnNameForView(SessionLocal session, int columnIndex) Get the column name of this expression for a view.
| |
| getCost | back to summary |
|---|---|
| public abstract int getCost() Estimate the cost to process the expression. Used when optimizing the query, to calculate the query plan with the lowest estimated cost.
| |
| getEnclosedSQL | back to summary |
|---|---|
| public final StringBuilder getEnclosedSQL(StringBuilder builder, int sqlFlags) Get the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization. Enclosing '(' and ')' are always appended.
| |
| getNonAliasExpression | back to summary |
|---|---|
| public Expression getNonAliasExpression() Returns the main expression, skipping aliases.
| |
| getNotIfPossible | back to summary |
|---|---|
| public Expression getNotIfPossible(SessionLocal session) 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.
| |
| getNullable | back to summary |
|---|---|
| public int getNullable() Check whether this expression is a column and can store NULL.
| |
| getSchemaName | back to summary |
|---|---|
| public String getSchemaName() Get the schema name, or null
| |
| getSQL | back to summary |
|---|---|
| public final String getSQL(int sqlFlags) Overrides default org. Doc from org. Get the SQL statement of this expression. This may not always be the original SQL statement, specially after optimization. | |
| getSQL | back to summary |
|---|---|
| public final StringBuilder getSQL(StringBuilder builder, int sqlFlags) Implements org. Doc from org. Appends the SQL statement of this object to the specified builder.
| |
| getSQL | back to summary |
|---|---|
| public final String getSQL(int sqlFlags, int parentheses) Get the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization.
| |
| getSQL | back to summary |
|---|---|
| public final StringBuilder getSQL(StringBuilder builder, int sqlFlags, int parentheses) Get the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization.
| |
| getSubexpression | back to summary |
|---|---|
| public Expression getSubexpression(int index) Returns subexpression with specified index.
| |
| getSubexpressionCount | back to summary |
|---|---|
| public int getSubexpressionCount() Returns count of subexpressions.
| |
| getTableAlias | back to summary |
|---|---|
| public String getTableAlias() Get the table alias name or null if this expression does not represent a column.
| |
| getTableName | back to summary |
|---|---|
| public String getTableName() Get the table name, or null
| |
| getType | back to summary |
|---|---|
| public abstract TypeInfo getType() Redeclares org. Returns the data type. The data type may be unknown before the optimization phase. | |
| getTypeIfStaticallyKnown | back to summary |
|---|---|
| public TypeInfo getTypeIfStaticallyKnown(SessionLocal session) Returns data type of this expression if it is statically known.
| |
| getUnenclosedSQL | back to summary |
|---|---|
| public abstract StringBuilder getUnenclosedSQL(StringBuilder builder, int sqlFlags) Get the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization. Enclosing '(' and ')' are never appended.
| |
| getValue | back to summary |
|---|---|
| public abstract Value getValue(SessionLocal session) Return the resulting value for the current row.
| |
| getWhenSQL | back to summary |
|---|---|
| public StringBuilder getWhenSQL(StringBuilder builder, int sqlFlags) Appends the SQL statement of this when operand to the specified builder.
| |
| getWhenValue | back to summary |
|---|---|
| public boolean getWhenValue(SessionLocal session, Value left) Return the resulting value of when operand for the current row.
| |
| isConstant | back to summary |
|---|---|
| public boolean isConstant() Check if this expression will always return the same value.
| |
| isEverything | back to summary |
|---|---|
| public abstract boolean isEverything(ExpressionVisitor visitor) Check if this expression and all sub-expressions can fulfill a criteria. If any part returns false, the result is false.
| |
| isIdentity | back to summary |
|---|---|
| public boolean isIdentity() Check if this is an identity column.
| |
| isNullConstant | back to summary |
|---|---|
| public boolean isNullConstant() Check if this expression will always return the NULL value.
| |
| isValueSet | back to summary |
|---|---|
| public boolean isValueSet() Is the value of a parameter set.
| |
| isWhenConditionOperand | back to summary |
|---|---|
| public boolean isWhenConditionOperand() Returns whether this expression is a right side of condition in a when operand.
| |
| mapColumns | back to summary |
|---|---|
| public abstract void mapColumns(ColumnResolver resolver, int level, int state) Map the columns of the resolver to expression columns.
| |
| needParentheses | back to summary |
|---|---|
| public boolean needParentheses() Returns whether this expressions needs to be wrapped in parentheses when it is used as an argument of other expressions.
| |
| optimize | back to summary |
|---|---|
| public abstract Expression optimize(SessionLocal session) Try to optimize the expression.
| |
| optimizeCondition | back to summary |
|---|---|
| public final Expression optimizeCondition(SessionLocal session) Try to optimize or remove the condition.
| |
| setEvaluatable | back to summary |
|---|---|
| public abstract void setEvaluatable(TableFilter tableFilter, boolean value) Tell the expression columns whether the table filter can return values now. This is used when optimizing the query.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Convert this expression to a String. | |
| updateAggregate | back to summary |
|---|---|
| public abstract void updateAggregate(SessionLocal session, int stage) Update an aggregate value. This method is called at statement execution time. It is usually called once for each row, but if the expression is used multiple times (for example in the column list, and as part of the HAVING expression) it is called multiple times - the row counter needs to be used to make sure the internal state is only updated once.
| |
| writeExpressions | back to summary |
|---|---|
| public static StringBuilder writeExpressions(StringBuilder builder, List<? extends Expression> expressions, int sqlFlags) Get the SQL snippet for a list of expressions.
| |
| writeExpressions | back to summary |
|---|---|
| public static StringBuilder writeExpressions(StringBuilder builder, Expression[] expressions, int sqlFlags) Get the SQL snippet for an array of expressions.
| |