Package org.apache.torque.util
Class JdbcTypedValue
java.lang.Object
org.apache.torque.util.JdbcTypedValue
A value for a column, with the JDBC type if it is an explicit value.
- Version:
- $Id: JdbcTypedValue.java 1917245 2024-04-21 14:06:23Z tv $
-
Constructor Summary
ConstructorsConstructorDescriptionJdbcTypedValue(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
Modifier and TypeMethodDescriptionbooleanintReturns the JDBC type as injava.sql.Types.Returns the sqlExpression to use instead of the value.getValue()Returns the value.inthashCode()voidsetJdbcType(int jdbcType) Sets the JDBC type as injava.sql.Types.voidSets the value.toString()
-
Constructor Details
-
JdbcTypedValue
Constructs a JdbcTypedValue with a value and a type.- Parameters:
value- The value; may be null.jdbcType- The JDBC type as injava.sql.Types.
-
JdbcTypedValue
Constructs a JdbcTypedValue with a verbatim SQL.- Parameters:
sqlExpression- The sql expression to use instead of the value.
-
-
Method Details
-
getJdbcType
public int getJdbcType()Returns the JDBC type as injava.sql.Types.- Returns:
- the JDBC type of the value.
-
setJdbcType
public void setJdbcType(int jdbcType) Sets the JDBC type as injava.sql.Types.- Parameters:
jdbcType- the JDBC type of the value.- Throws:
IllegalStateException- if sqlExpression is set.
-
getValue
Returns the value.- Returns:
- value the value, or null.
-
getSqlExpression
Returns the sqlExpression to use instead of the value.- Returns:
- value the sqlExpression, or null if not set.
-
setValue
Sets the value.- Parameters:
value- the value, may be null.- Throws:
IllegalStateException- if sqlExpression is set.
-
hashCode
public int hashCode() -
equals
-
toString
-