public final class KeyGeneratorTypeHandlerShort extends Object implements KeyGeneratorTypeHandler<Short>
KeyGeneratorTypeHandler
for Short
type.Constructor and Description |
---|
KeyGeneratorTypeHandlerShort(boolean fail)
Construct an type handler for Short values.
|
KeyGeneratorTypeHandlerShort(boolean fail,
int allocationSize) |
Modifier and Type | Method and Description |
---|---|
Short |
add(Short 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,
Short value)
Binds the value in the sql preparedstatement at the provided index
location.
|
Short |
getNextValue(ResultSet rs)
Gets the value from resultset by calling getValue method and then
calls the increment method to increment the extracted value.
|
Short |
getValue(ResultSet rs)
Reads the resultset and return the extracted typehandler value from the
resultset.
|
Short |
increment(Short value)
Increments the provided value by ONE.
|
public KeyGeneratorTypeHandlerShort(boolean fail)
fail
- true
if the type handler should fail when current
row of the record set is not valid, false
otherwise.public KeyGeneratorTypeHandlerShort(boolean fail, int allocationSize)
public Short getNextValue(ResultSet rs) throws PersistenceException, SQLException
getNextValue
in interface KeyGeneratorTypeHandler<Short>
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 Short getValue(ResultSet rs) throws PersistenceException, SQLException
getValue
in interface KeyGeneratorTypeHandler<Short>
rs
- ResultSet objectPersistenceException
- 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 Short increment(Short value)
increment
in interface KeyGeneratorTypeHandler<Short>
value
- value to be incremented.public Short add(Short value, int offset)
add
in interface KeyGeneratorTypeHandler<Short>
value
- Handler instance in which new value will be addedoffset
- Offset location. *public void bindValue(PreparedStatement stmt, int index, Short value) throws SQLException
bindValue
in interface KeyGeneratorTypeHandler<Short>
stmt
- A SQL PreparedStatement.index
- Index location for binding parameter to statement.value
- Value to be bindedSQLException
- If SQL error occurs in binding param to sql statement.Copyright © 2013. All rights reserved.