Top Description Fields Constructors Methods
org.h2.expression

public Class TypedValueExpression

extends ValueExpression
Class Inheritance
Imports
java.util.Objects, org.h2.value.DataType, .TypeInfo, .Value, .ValueNull

An expression representing a constant value with a type cast.

Field Summary

Modifier and TypeField and Description
private final TypeInfo
public static final TypedValueExpression
UNKNOWN

The expression represents the SQL UNKNOWN value.

Inherited from org.h2.expression.ValueExpression:
DEFAULTFALSENULLTRUEvalue

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ValueExpression

Returns:

the expression
get
(Value
the value
value
,
TypeInfo
the value type
type
)

Create a new expression with the given value and type.

private static ValueExpression
getImpl(Value value, TypeInfo type, boolean preserveStrictType)

public TypeInfo
getType()

Overrides org.h2.expression.ValueExpression.getType.

Implements org.h2.value.Typed.getType.

Returns the data type.

public static ValueExpression

Returns:

the expression
getTypedIfNull
(Value
the value
value
,
TypeInfo
the value type
type
)

Create a new typed value expression with the given value and type if value is NULL, or a plain value expression otherwise.

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

Overrides org.h2.expression.ValueExpression.getUnenclosedSQL.

Get the SQL statement of this expression.

public boolean
isNullConstant()

Overrides org.h2.expression.ValueExpression.isNullConstant.

Check if this expression will always return the NULL value.

Inherited from org.h2.expression.ValueExpression:
createIndexConditionsgetgetBooleangetBooleangetCostgetNotIfPossiblegetTypeIfStaticallyKnowngetValueisConstantisEverythingisValueSet

Field Detail

typeback to summary
private final TypeInfo type
UNKNOWNback to summary
public static final TypedValueExpression UNKNOWN

The expression represents the SQL UNKNOWN value.

Constructor Detail

TypedValueExpressionback to summary
private TypedValueExpression(Value value, TypeInfo type)

Method Detail

getback to summary
public static ValueExpression get(Value value, TypeInfo type)

Create a new expression with the given value and type.

Parameters
value:Value

the value

type:TypeInfo

the value type

Returns:ValueExpression

the expression

getImplback to summary
private static ValueExpression getImpl(Value value, TypeInfo type, boolean preserveStrictType)
getTypeback to summary
public TypeInfo getType()

Overrides org.h2.expression.ValueExpression.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
getTypedIfNullback to summary
public static ValueExpression getTypedIfNull(Value value, TypeInfo type)

Create a new typed value expression with the given value and type if value is NULL, or a plain value expression otherwise.

Parameters
value:Value

the value

type:TypeInfo

the value type

Returns:ValueExpression

the expression

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

Overrides org.h2.expression.ValueExpression.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
isNullConstantback to summary
public boolean isNullConstant()

Overrides org.h2.expression.ValueExpression.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