Top Description Fields Constructors Methods
org.h2.expression.condition

public final Class NullPredicate

extends SimplePredicate
Class Inheritance
Imports
java.util.ArrayList, org.h2.engine.SessionLocal, org.h2.expression.Expression, .ExpressionColumn, .ExpressionList, .ValueExpression, org.h2.index.IndexCondition, org.h2.table.TableFilter, org.h2.value.Value, .ValueBoolean, .ValueNull, .ValueRow

Null predicate (IS [NOT] NULL).

Field Summary

Modifier and TypeField and Description
private boolean
Inherited from org.h2.expression.condition.SimplePredicate:
leftnotwhenOperand

Constructor Summary

AccessConstructor and Description
public
NullPredicate(Expression left, boolean not, boolean whenOperand)

Method Summary

Modifier and TypeMethod and Description
public void
createIndexConditions(SessionLocal
the session
session
,
TableFilter
the table filter
filter
)

Overrides org.h2.expression.Expression.createIndexConditions.

Create index conditions if possible and attach them to the table filter.

private static void
public Expression
getNotIfPossible(SessionLocal
the session
session
)

Overrides org.h2.expression.Expression.getNotIfPossible.

If it is possible, return the negated expression.

public StringBuilder
getUnenclosedSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Implements abstract org.h2.expression.Expression.getUnenclosedSQL.

Get the SQL statement of this expression.

public Value
getValue(SessionLocal
the session
session
)

Implements abstract org.h2.expression.Expression.getValue.

Return the resulting value for the current row.

private boolean
public StringBuilder
getWhenSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Overrides org.h2.expression.Expression.getWhenSQL.

Appends the SQL statement of this when operand to the specified builder.

public boolean
getWhenValue(SessionLocal
the session
session
,
Value
value on the left side
left
)

Overrides org.h2.expression.Expression.getWhenValue.

Return the resulting value of when operand for the current row.

public Expression
optimize(SessionLocal
the session
session
)

Overrides org.h2.expression.condition.SimplePredicate.optimize.

Try to optimize the expression.

Inherited from org.h2.expression.condition.SimplePredicate:
getCostgetSubexpressiongetSubexpressionCountisEverythingisWhenConditionOperandmapColumnsneedParenthesessetEvaluatableupdateAggregate

Field Detail

optimizedback to summary
private boolean optimized

Constructor Detail

NullPredicateback to summary
public NullPredicate(Expression left, boolean not, boolean whenOperand)

Method Detail

createIndexConditionsback to summary
public void createIndexConditions(SessionLocal session, TableFilter filter)

Overrides org.h2.expression.Expression.createIndexConditions.

Doc from org.h2.expression.Expression.createIndexConditions.

Create index conditions if possible and attach them to the table filter.

Parameters
session:SessionLocal

the session

filter:TableFilter

the table filter

Annotations
@Override
createNullIndexConditionback to summary
private static void createNullIndexCondition(TableFilter filter, ExpressionColumn c)
getNotIfPossibleback to summary
public Expression getNotIfPossible(SessionLocal session)

Overrides org.h2.expression.Expression.getNotIfPossible.

Doc from org.h2.expression.Expression.getNotIfPossible.

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:SessionLocal

the session

Returns:Expression

the negated expression, or null

Annotations
@Override
getUnenclosedSQLback to summary
public StringBuilder getUnenclosedSQL(StringBuilder builder, int sqlFlags)

Implements abstract org.h2.expression.Expression.getUnenclosedSQL.

Doc from org.h2.expression.Expression.getUnenclosedSQL.

Get the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization. Enclosing '(' and ')' are never appended.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getValueback to summary
public Value getValue(SessionLocal session)

Implements abstract org.h2.expression.Expression.getValue.

Doc from org.h2.expression.Expression.getValue.

Return the resulting value for the current row.

Parameters
session:SessionLocal

the session

Returns:Value

the result

Annotations
@Override
getValueback to summary
private boolean getValue(Value left)
getWhenSQLback to summary
public StringBuilder getWhenSQL(StringBuilder builder, int sqlFlags)

Overrides org.h2.expression.Expression.getWhenSQL.

Doc from org.h2.expression.Expression.getWhenSQL.

Appends the SQL statement of this when operand to the specified builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getWhenValueback to summary
public boolean getWhenValue(SessionLocal session, Value left)

Overrides org.h2.expression.Expression.getWhenValue.

Doc from org.h2.expression.Expression.getWhenValue.

Return the resulting value of when operand for the current row.

Parameters
session:SessionLocal

the session

left:Value

value on the left side

Returns:boolean

the result

Annotations
@Override
optimizeback to summary
public Expression optimize(SessionLocal session)

Overrides org.h2.expression.condition.SimplePredicate.optimize.

Doc from org.h2.expression.Expression.optimize.

Try to optimize the expression.

Parameters
session:SessionLocal

the session

Returns:Expression

the optimized expression

Annotations
@Override