Package org.h2.expression
Class TypedValueExpression
java.lang.Object
org.h2.expression.Expression
org.h2.expression.Operation0
org.h2.expression.ValueExpression
org.h2.expression.TypedValueExpression
An expression representing a constant value with a type cast.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeInfo
static final TypedValueExpression
The expression represents the SQL UNKNOWN value.Fields inherited from class org.h2.expression.Expression
AUTO_PARENTHESES, MAP_IN_AGGREGATE, MAP_IN_WINDOW, MAP_INITIAL, WITH_PARENTHESES, WITHOUT_PARENTHESES
Fields inherited from interface org.h2.util.HasSQL
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueExpression
Create a new expression with the given value and type.private static ValueExpression
getType()
Returns the data type.static ValueExpression
getTypedIfNull
(Value value, TypeInfo type) Create a new typed value expression with the given value and type if value isNULL
, or a plain value expression otherwise.getUnenclosedSQL
(StringBuilder builder, int sqlFlags) Get the SQL statement of this expression.boolean
Check if this expression will always return the NULL value.Methods inherited from class org.h2.expression.ValueExpression
createIndexConditions, get, getBoolean, getBoolean, getCost, getNotIfPossible, getValue, isConstant, isEverything, isValueSet
Methods inherited from class org.h2.expression.Operation0
mapColumns, optimize, setEvaluatable, updateAggregate
Methods inherited from class org.h2.expression.Expression
addFilterConditions, getAlias, getBooleanValue, getColumnName, getColumnNameForView, getEnclosedSQL, getNonAliasExpression, getNullable, getSchemaName, getSQL, getSQL, getSQL, getSQL, getSubexpression, getSubexpressionCount, getTableAlias, getTableName, getWhenSQL, getWhenValue, isIdentity, isWhenConditionOperand, needParentheses, optimizeCondition, toString, writeExpressions, writeExpressions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
Field Details
-
UNKNOWN
The expression represents the SQL UNKNOWN value. -
type
-
-
Constructor Details
-
TypedValueExpression
-
-
Method Details
-
get
Create a new expression with the given value and type.- Parameters:
value
- the valuetype
- the value type- Returns:
- the expression
-
getTypedIfNull
Create a new typed value expression with the given value and type if value isNULL
, or a plain value expression otherwise.- Parameters:
value
- the valuetype
- the value type- Returns:
- the expression
-
getImpl
-
getType
Description copied from class:Expression
Returns the data type. The data type may be unknown before the optimization phase.- Specified by:
getType
in interfaceTyped
- Overrides:
getType
in classValueExpression
- Returns:
- the data type
-
getUnenclosedSQL
Description copied from class:Expression
Get the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization. Enclosing '(' and ')' are never appended.- Overrides:
getUnenclosedSQL
in classValueExpression
- Parameters:
builder
- string buildersqlFlags
- formatting flags- Returns:
- the specified string builder
-
isNullConstant
public boolean isNullConstant()Description copied from class:Expression
Check if this expression will always return the NULL value.- Overrides:
isNullConstant
in classValueExpression
- Returns:
- if the expression is constant NULL value
-