Class TypedValueExpression

  • All Implemented Interfaces:
    HasSQL, Typed

    public class TypedValueExpression
    extends ValueExpression
    An expression representing a constant value with a type cast.
    • Field Detail

      • UNKNOWN

        public static final TypedValueExpression UNKNOWN
        The expression represents the SQL UNKNOWN value.
    • Constructor Detail

      • TypedValueExpression

        private TypedValueExpression​(Value value,
                                     TypeInfo type)
    • Method Detail

      • get

        public static ValueExpression get​(Value value,
                                          TypeInfo type)
        Create a new expression with the given value and type.
        Parameters:
        value - the value
        type - the value type
        Returns:
        the expression
      • getTypedIfNull

        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 - the value
        type - the value type
        Returns:
        the expression
      • getType

        public TypeInfo getType()
        Description copied from class: Expression
        Returns the data type. The data type may be unknown before the optimization phase.
        Specified by:
        getType in interface Typed
        Overrides:
        getType in class ValueExpression
        Returns:
        the data type
      • getUnenclosedSQL

        public java.lang.StringBuilder getUnenclosedSQL​(java.lang.StringBuilder builder,
                                                        int sqlFlags)
        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 class ValueExpression
        Parameters:
        builder - string builder
        sqlFlags - 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 class ValueExpression
        Returns:
        if the expression is constant NULL value