Class JdbcTypedValue


  • public class JdbcTypedValue
    extends Object
    A value for a column, with the JDBC type if it is an explicit value.
    Version:
    $Id: JdbcTypedValue.java 1867515 2019-09-25 15:02:03Z gk $
    • Constructor Detail

      • JdbcTypedValue

        public JdbcTypedValue​(Object value,
                              int jdbcType)
        Constructs a JdbcTypedValue with a value and a type.
        Parameters:
        jdbcType - The JDBC type as in java.sql.Types.
        value - The value; may be null.
      • JdbcTypedValue

        public JdbcTypedValue​(Column sqlExpression)
        Constructs a JdbcTypedValue with a verbatim SQL.
        Parameters:
        sqlExpression - The sql expression to use instead of the value.
    • Method Detail

      • getJdbcType

        public int getJdbcType()
        Returns the JDBC type as in java.sql.Types.
        Returns:
        the JDBC type of the value.
      • setJdbcType

        public void setJdbcType​(int jdbcType)
        Sets the JDBC type as in java.sql.Types.
        Parameters:
        jdbcType - the JDBC type of the value.
        Throws:
        IllegalStateException - if sqlExpression is set.
      • getValue

        public Object getValue()
        Returns the value.
        Returns:
        value the value, or null.
      • getSqlExpression

        public Column getSqlExpression()
        Returns the sqlExpression to use instead of the value.
        Returns:
        value the sqlExpression, or null if not set.
      • setValue

        public void setValue​(Object value)
        Sets the value.
        Parameters:
        value - the value, may be null.
        Throws:
        IllegalStateException - if sqlExpression is set.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object