KeyGeneratorTypeHandler<java.math.BigDecimal>
public final class KeyGeneratorTypeHandlerBigDecimal extends java.lang.Object implements KeyGeneratorTypeHandler<java.math.BigDecimal>
Constructor | Description |
---|---|
KeyGeneratorTypeHandlerBigDecimal(boolean fail) |
Construct an type handler for big decimal values.
|
KeyGeneratorTypeHandlerBigDecimal(boolean fail,
int allocationSize) |
Modifier and Type | Method | Description |
---|---|---|
java.math.BigDecimal |
add(java.math.BigDecimal value,
int offset) |
Adds the new Type Handler of type T to the provided handler instance at
the provided offset.
|
void |
bindValue(java.sql.PreparedStatement stmt,
int index,
java.math.BigDecimal value) |
Binds the value in the sql preparedstatement at the provided index
location.
|
java.math.BigDecimal |
getNextValue(java.sql.ResultSet rs) |
Gets the value from resultset by calling getValue method and then
calls the increment method to increment the extracted value.
|
java.math.BigDecimal |
getValue(java.sql.ResultSet rs) |
Reads the resultset and return the extracted typehandler value from the
resultset.
|
java.math.BigDecimal |
increment(java.math.BigDecimal value) |
Increments the provided value by ONE.
|
public KeyGeneratorTypeHandlerBigDecimal(boolean fail)
fail
- true
if the type handler should fail when current row of the
record set is not valid, false
otherwise.public KeyGeneratorTypeHandlerBigDecimal(boolean fail, int allocationSize)
public java.math.BigDecimal getNextValue(java.sql.ResultSet rs) throws PersistenceException, java.sql.SQLException
getNextValue
in interface KeyGeneratorTypeHandler<java.math.BigDecimal>
rs
- A ResultSet object.PersistenceException
- If ResultSet is empty or if the type handler
should fail when current row of the record set is not valid,java.sql.SQLException
- If database error occurs.public java.math.BigDecimal getValue(java.sql.ResultSet rs) throws PersistenceException, java.sql.SQLException
getValue
in interface KeyGeneratorTypeHandler<java.math.BigDecimal>
rs
- ResultSet objectPersistenceException
- If ResultSet is empty or if the type handler
should fail when current row of the record set is not valid,java.sql.SQLException
- If database error occurs.public java.math.BigDecimal increment(java.math.BigDecimal value)
increment
in interface KeyGeneratorTypeHandler<java.math.BigDecimal>
value
- value to be incremented.public java.math.BigDecimal add(java.math.BigDecimal value, int offset)
add
in interface KeyGeneratorTypeHandler<java.math.BigDecimal>
value
- Handler instance in which new value will be addedoffset
- Offset location. *public void bindValue(java.sql.PreparedStatement stmt, int index, java.math.BigDecimal value) throws java.sql.SQLException
bindValue
in interface KeyGeneratorTypeHandler<java.math.BigDecimal>
stmt
- A SQL PreparedStatement.index
- Index location for binding parameter to statement.value
- Value to be bindedjava.sql.SQLException
- If SQL error occurs in binding param to sql statement.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com