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 TypeFieldDescriptionstatic final TypedValueExpressionThe expression represents the SQL UNKNOWN value.Fields inherited from class org.h2.expression.ValueExpression
DEFAULT, FALSE, NULL, TRUEFields inherited from class org.h2.expression.Expression
AUTO_PARENTHESES, MAP_IN_AGGREGATE, MAP_IN_WINDOW, MAP_INITIAL, WITH_PARENTHESES, WITHOUT_PARENTHESESFields 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 -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueExpressionCreate a new expression with the given value and type.getType()Returns the data type.static ValueExpressiongetTypedIfNull(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.booleanCheck if this expression will always return the NULL value.Methods inherited from class org.h2.expression.ValueExpression
createIndexConditions, get, getBoolean, getBoolean, getCost, getNotIfPossible, getTypeIfStaticallyKnown, getValue, isConstant, isEverything, isValueSetMethods inherited from class org.h2.expression.Operation0
mapColumns, optimize, setEvaluatable, updateAggregateMethods 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, writeExpressionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
Field Details
-
UNKNOWN
The expression represents the SQL UNKNOWN value.
-
-
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
-
getType
Description copied from class:ExpressionReturns the data type. The data type may be unknown before the optimization phase.- Specified by:
getTypein interfaceTyped- Overrides:
getTypein classValueExpression- Returns:
- the data type
-
getUnenclosedSQL
Description copied from class:ExpressionGet the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization. Enclosing '(' and ')' are never appended.- Overrides:
getUnenclosedSQLin classValueExpression- Parameters:
builder- string buildersqlFlags- formatting flags- Returns:
- the specified string builder
-
isNullConstant
public boolean isNullConstant()Description copied from class:ExpressionCheck if this expression will always return the NULL value.- Overrides:
isNullConstantin classValueExpression- Returns:
- if the expression is constant NULL value
-