public class ScalarTypeBigDecimal extends ScalarTypeBase<BigDecimal>
jdbcNative, jdbcType, type| Constructor and Description |
|---|
ScalarTypeBigDecimal() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(DataBind b,
BigDecimal value)
Convert (if necessary) and bind the value to the preparedStatement.
|
String |
formatValue(BigDecimal t)
Convert the type into a string representation.
|
boolean |
isDateTimeCapable()
Return true if the type can accept long systemTimeMillis input.
|
BigDecimal |
parse(String value)
Convert the string value to the appropriate java object.
|
BigDecimal |
parseDateTime(long systemTimeMillis)
Convert the systemTimeMillis into the appropriate java object.
|
BigDecimal |
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical
bean property value.
|
Object |
readData(DataInput dataInput) |
BigDecimal |
toBeanType(Object value)
Convert the value as necessary to the logical Bean type.
|
Object |
toJdbcType(Object value)
Convert the value as necessary to the JDBC type.
|
void |
writeData(DataOutput dataOutput,
Object v) |
accumulateScalarTypes, format, getDbNullValue, getJdbcType, getLength, getType, isDbNull, isJdbcNative, jsonFromString, jsonToString, jsonWrite, loadIgnorepublic Object readData(DataInput dataInput) throws IOException
IOExceptionpublic void writeData(DataOutput dataOutput, Object v) throws IOException
IOExceptionpublic void bind(DataBind b, BigDecimal value) throws SQLException
ScalarTypevalue may need to be converted from the logical bean property type to the JDBC type.
SQLExceptionpublic BigDecimal read(DataReader dataReader) throws SQLException
ScalarTypeSQLExceptionpublic Object toJdbcType(Object value)
ScalarTypeNote that this should also match the type as per the getJdbcType() method.
This is typically used when the matching type is used in a where clause and we use this to ensure it is an appropriate jdbc type.
public BigDecimal toBeanType(Object value)
ScalarTypeThe type as per the bean property.
This is used to automatically convert id values (typically from a string to a int, long or UUID).
public String formatValue(BigDecimal t)
ScalarTypeReciprocal of parse().
public BigDecimal parse(String value)
ScalarTypeMostly used to support CSV, JSON and XML parsing.
Reciprocal of formatValue().
public BigDecimal parseDateTime(long systemTimeMillis)
ScalarTypeFor non dateTime types this will throw an exception.
public boolean isDateTimeCapable()
ScalarType
This is used to determine if is is sensible to use the
ScalarType.parseDateTime(long) method.
This includes the Date, Calendar, sql Date, Time, Timestamp, JODA types as well as Long, BigDecimal and String (although it generally is not expected to parse systemTimeMillis to a String or BigDecimal).
Copyright © 2014. All Rights Reserved.