Package org.apache.torque.util

## Class JdbcTypedValue

- java.lang.Object
- - org.apache.torque.util.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 Summary

    Constructors
    Constructor | Description
    --- | ---
    `JdbcTypedValue​(Object value, int jdbcType)` | Constructs a JdbcTypedValue with a value and a type.
    `JdbcTypedValue​(Column sqlExpression)` | Constructs a JdbcTypedValue with a verbatim SQL.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(Object obj)` |
    `int` | `getJdbcType()` | Returns the JDBC type as in `java.sql.Types`.
    `Column` | `getSqlExpression()` | Returns the sqlExpression to use instead of the value.
    `Object` | `getValue()` | Returns the value.
    `int` | `hashCode()` |
    `void` | `setJdbcType​(int jdbcType)` | Sets the JDBC type as in `java.sql.Types`.
    `void` | `setValue​(Object value)` | Sets the value.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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`

    - #### equals

          public boolean equals​(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`