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 booleanequals(Object obj)intgetJdbcType()Returns the JDBC type as injava.sql.Types.ColumngetSqlExpression()Returns the sqlExpression to use instead of the value.ObjectgetValue()Returns the value.inthashCode()voidsetJdbcType(int jdbcType)Sets the JDBC type as injava.sql.Types.voidsetValue(Object value)Sets the value.StringtoString()
-
-
-
Constructor Detail
-
JdbcTypedValue
public JdbcTypedValue(Object value, int jdbcType)
Constructs a JdbcTypedValue with a value and a type.- Parameters:
jdbcType- The JDBC type as injava.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 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
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.
-
-