public final class ConditionInQuery extends Expression
AUTO_PARENTHESES, MAP_IN_AGGREGATE, MAP_IN_WINDOW, MAP_INITIAL, WITH_PARENTHESES, WITHOUT_PARENTHESES
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
Constructor and Description |
---|
ConditionInQuery(Expression left,
boolean not,
boolean whenOperand,
Query query,
boolean all,
int compareType) |
Modifier and Type | Method and Description |
---|---|
void |
createIndexConditions(SessionLocal session,
TableFilter filter)
Create index conditions if possible and attach them to the table filter.
|
int |
getCost()
Estimate the cost to process the expression.
|
Expression |
getNotIfPossible(SessionLocal session)
If it is possible, return the negated expression.
|
TypeInfo |
getType()
Returns the data type.
|
java.lang.StringBuilder |
getUnenclosedSQL(java.lang.StringBuilder builder,
int sqlFlags)
Get the SQL statement of this expression.
|
Value |
getValue(SessionLocal session)
Return the resulting value for the current row.
|
java.lang.StringBuilder |
getWhenSQL(java.lang.StringBuilder builder,
int sqlFlags)
Appends the SQL statement of this when operand to the specified builder.
|
boolean |
getWhenValue(SessionLocal session,
Value left)
Return the resulting value of when operand for the current row.
|
boolean |
isEverything(ExpressionVisitor visitor)
Check if this expression and all sub-expressions can fulfill a criteria.
|
boolean |
isWhenConditionOperand()
Returns whether this expression is a right side of condition in a when
operand.
|
void |
mapColumns(ColumnResolver resolver,
int level,
int state)
Map the columns of the resolver to expression columns.
|
boolean |
needParentheses()
Returns whether this expressions needs to be wrapped in parentheses when
it is used as an argument of other expressions.
|
Expression |
optimize(SessionLocal session)
Try to optimize the expression.
|
void |
setEvaluatable(TableFilter tableFilter,
boolean b)
Tell the expression columns whether the table filter can return values
now.
|
void |
updateAggregate(SessionLocal session,
int stage)
Update an aggregate value.
|
addFilterConditions, getAlias, getBooleanValue, getColumnName, getColumnNameForView, getEnclosedSQL, getNonAliasExpression, getNullable, getSchemaName, getSQL, getSQL, getSQL, getSQL, getSubexpression, getSubexpressionCount, getTableAlias, getTableName, isConstant, isIdentity, isNullConstant, isValueSet, optimizeCondition, toString, writeExpressions, writeExpressions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTraceSQL
public ConditionInQuery(Expression left, boolean not, boolean whenOperand, Query query, boolean all, int compareType)
public Value getValue(SessionLocal session)
Expression
getValue
in class Expression
session
- the sessionpublic boolean getWhenValue(SessionLocal session, Value left)
Expression
getWhenValue
in class Expression
session
- the sessionleft
- value on the left sidepublic boolean isWhenConditionOperand()
Expression
isWhenConditionOperand
in class Expression
true
if it is, false
otherwisepublic Expression getNotIfPossible(SessionLocal session)
Expression
getNotIfPossible
in class Expression
session
- the sessionpublic void mapColumns(ColumnResolver resolver, int level, int state)
Expression
resolver
- the column resolverlevel
- the subquery nesting levelstate
- current state for nesting checks, initial value is
Expression.MAP_INITIAL
public Expression optimize(SessionLocal session)
Expression
session
- the sessionpublic void setEvaluatable(TableFilter tableFilter, boolean b)
Expression
tableFilter
- the table filterb
- true if the table filter can return valuepublic boolean needParentheses()
Expression
needParentheses
in class Expression
true
if it ispublic java.lang.StringBuilder getUnenclosedSQL(java.lang.StringBuilder builder, int sqlFlags)
Expression
builder
- string buildersqlFlags
- formatting flagspublic java.lang.StringBuilder getWhenSQL(java.lang.StringBuilder builder, int sqlFlags)
Expression
getWhenSQL
in class Expression
builder
- string buildersqlFlags
- formatting flagspublic void updateAggregate(SessionLocal session, int stage)
Expression
session
- the sessionstage
- select stagepublic boolean isEverything(ExpressionVisitor visitor)
Expression
visitor
- the visitorpublic int getCost()
Expression
public void createIndexConditions(SessionLocal session, TableFilter filter)
Expression
createIndexConditions
in class Expression
session
- the sessionfilter
- the table filterpublic TypeInfo getType()
Expression
getType
in interface Typed
getType
in class Expression