Top Description Fields Constructors Methods
org.h2.expression

public Class ValueExpression

extends Operation0
Class Inheritance
Known Direct Subclasses
org.h2.expression.TypedValueExpression
Imports
org.h2.engine.SessionLocal, org.h2.expression.condition.Comparison, org.h2.index.IndexCondition, org.h2.table.TableFilter, org.h2.value.TypeInfo, .Value, .ValueBoolean, .ValueNull

An expression representing a constant value.

Field Summary

Modifier and TypeField and Description
public static final ValueExpression
DEFAULT

This special expression represents the default value.

public static final ValueExpression
FALSE

The expression represents ValueBoolean.FALSE.

public static final ValueExpression
NULL

The expression represents ValueNull.INSTANCE.

public static final ValueExpression
TRUE

The expression represents ValueBoolean.TRUE.

pack-priv final Value
value

The value.

Constructor Summary

AccessConstructor and Description
pack-priv

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.

public static ValueExpression

Returns:

the expression
get
(Value
the value
value
)

Create a new expression with the given value.

public static ValueExpression

Returns:

the expression
getBoolean
(Value
the boolean value
value
)

Create a new expression with the given boolean value.

public static ValueExpression

Returns:

the expression
getBoolean
(boolean
the boolean value
value
)

Create a new expression with the given boolean value.

public int
getCost()

Implements abstract org.h2.expression.Expression.getCost.

Estimate the cost to process the expression.

public Expression
getNotIfPossible(SessionLocal
the session
session
)

Overrides org.h2.expression.Expression.getNotIfPossible.

If it is possible, return the negated expression.

public TypeInfo
getType()

Implements abstract org.h2.expression.Expression.getType.

Implements org.h2.value.Typed.getType.

Returns the data type.

public TypeInfo
getTypeIfStaticallyKnown(SessionLocal
the session
session
)

Overrides org.h2.expression.Expression.getTypeIfStaticallyKnown.

Returns data type of this expression if it is statically known.

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.

public boolean
isConstant()

Overrides org.h2.expression.Expression.isConstant.

Check if this expression will always return the same value.

public boolean
isEverything(ExpressionVisitor
the visitor
visitor
)

Implements abstract org.h2.expression.Expression.isEverything.

Check if this expression and all sub-expressions can fulfill a criteria.

public boolean
isNullConstant()

Overrides org.h2.expression.Expression.isNullConstant.

Check if this expression will always return the NULL value.

public boolean
isValueSet()

Overrides org.h2.expression.Expression.isValueSet.

Is the value of a parameter set.

Inherited from org.h2.expression.Operation0:
mapColumnsoptimizesetEvaluatableupdateAggregate

Field Detail

DEFAULTback to summary
public static final ValueExpression DEFAULT

This special expression represents the default value. It is used for UPDATE statements of the form SET COLUMN = DEFAULT. The value is ValueNull.INSTANCE, but should never be accessed.

FALSEback to summary
public static final ValueExpression FALSE

The expression represents ValueBoolean.FALSE.

NULLback to summary
public static final ValueExpression NULL

The expression represents ValueNull.INSTANCE.

TRUEback to summary
public static final ValueExpression TRUE

The expression represents ValueBoolean.TRUE.

valueback to summary
pack-priv final Value value

The value.

Constructor Detail

ValueExpressionback to summary
pack-priv ValueExpression(Value value)

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
getback to summary
public static ValueExpression get(Value value)

Create a new expression with the given value.

Parameters
value:Value

the value

Returns:ValueExpression

the expression

getBooleanback to summary
public static ValueExpression getBoolean(Value value)

Create a new expression with the given boolean value.

Parameters
value:Value

the boolean value

Returns:ValueExpression

the expression

getBooleanback to summary
public static ValueExpression getBoolean(boolean value)

Create a new expression with the given boolean value.

Parameters
value:boolean

the boolean value

Returns:ValueExpression

the expression

getCostback to summary
public int getCost()

Implements abstract org.h2.expression.Expression.getCost.

Doc from org.h2.expression.Expression.getCost.

Estimate the cost to process the expression. Used when optimizing the query, to calculate the query plan with the lowest estimated cost.

Returns:int

the estimated cost

Annotations
@Override
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
getTypeback to summary
public TypeInfo getType()

Implements abstract org.h2.expression.Expression.getType.

Implements org.h2.value.Typed.getType.

Doc from org.h2.expression.Expression.getType.

Returns the data type. The data type may be unknown before the optimization phase.

Returns:TypeInfo

the data type

Annotations
@Override
getTypeIfStaticallyKnownback to summary
public TypeInfo getTypeIfStaticallyKnown(SessionLocal session)

Overrides org.h2.expression.Expression.getTypeIfStaticallyKnown.

Doc from org.h2.expression.Expression.getTypeIfStaticallyKnown.

Returns data type of this expression if it is statically known.

Parameters
session:SessionLocal

the session

Returns:TypeInfo

data type 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
isConstantback to summary
public boolean isConstant()

Overrides org.h2.expression.Expression.isConstant.

Doc from org.h2.expression.Expression.isConstant.

Check if this expression will always return the same value.

Returns:boolean

if the expression is constant

Annotations
@Override
isEverythingback to summary
public boolean isEverything(ExpressionVisitor visitor)

Implements abstract org.h2.expression.Expression.isEverything.

Doc from org.h2.expression.Expression.isEverything.

Check if this expression and all sub-expressions can fulfill a criteria. If any part returns false, the result is false.

Parameters
visitor:ExpressionVisitor

the visitor

Returns:boolean

if the criteria can be fulfilled

Annotations
@Override
isNullConstantback to summary
public boolean isNullConstant()

Overrides org.h2.expression.Expression.isNullConstant.

Doc from org.h2.expression.Expression.isNullConstant.

Check if this expression will always return the NULL value.

Returns:boolean

if the expression is constant NULL value

Annotations
@Override
isValueSetback to summary
public boolean isValueSet()

Overrides org.h2.expression.Expression.isValueSet.

Doc from org.h2.expression.Expression.isValueSet.

Is the value of a parameter set.

Returns:boolean

true if set

Annotations
@Override