|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.cpa.persistence.sql.keygen.KeyGeneratorTypeHandlerBigDecimal
public final class KeyGeneratorTypeHandlerBigDecimal
Class implementing the KeyGeneratorTypeHandler for BigDecimal type.
| Constructor Summary | |
|---|---|
KeyGeneratorTypeHandlerBigDecimal(boolean fail)
Construct an type handler for big decimal values. |
|
| Method Summary | |
|---|---|
BigDecimal |
add(BigDecimal value,
int offset)
Adds the new Type Handler of type T to the provided handler instance at the provided offset. |
void |
bindValue(PreparedStatement stmt,
int index,
BigDecimal value)
Binds the value in the sql preparedstatement at the provided index location. |
BigDecimal |
getNextValue(ResultSet rs)
Gets the value from resultset by calling getValue method and then calls the increment method to increment the extracted value. |
BigDecimal |
getValue(ResultSet rs)
Reads the resultset and return the extracted typehandler value from the resultset. |
BigDecimal |
increment(BigDecimal value)
Increments the provided value by ONE. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KeyGeneratorTypeHandlerBigDecimal(boolean fail)
fail - true if the type handler should fail when current row of the
record set is not valid, false otherwise.| Method Detail |
|---|
public BigDecimal getNextValue(ResultSet rs)
throws PersistenceException,
SQLException
getNextValue in interface KeyGeneratorTypeHandler<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,
SQLException - If database error occurs.
public BigDecimal getValue(ResultSet rs)
throws PersistenceException,
SQLException
getValue in interface KeyGeneratorTypeHandler<BigDecimal>rs - ResultSet object
PersistenceException - If ResultSet is empty or if the type handler
should fail when current row of the record set is not valid,
SQLException - If database error occurs.public BigDecimal increment(BigDecimal value)
increment in interface KeyGeneratorTypeHandler<BigDecimal>value - value to be incremented.
public BigDecimal add(BigDecimal value,
int offset)
add in interface KeyGeneratorTypeHandler<BigDecimal>value - Handler instance in which new value will be addedoffset - Offset location. *
public void bindValue(PreparedStatement stmt,
int index,
BigDecimal value)
throws SQLException
bindValue in interface KeyGeneratorTypeHandler<BigDecimal>stmt - A SQL PreparedStatement.index - Index location for binding parameter to statement.value - Value to be binded
SQLException - If SQL error occurs in binding param to sql statement.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||