org.castor.cpa.persistence.sql.keygen.typehandler
T
- Name of KeyGeneratorTypeHandler interface.public interface KeyGeneratorTypeHandler<T>
Modifier and Type | Method and Description |
---|---|
T |
add(T 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,
T value)
Binds the value in the sql preparedstatement at the provided index
location.
|
T |
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.
|
T |
getValue(java.sql.ResultSet rs)
Reads the resultset and return the extracted typehandler value from the
resultset.
|
T |
increment(T value)
Increments the provided value by ONE.
|
T getNextValue(java.sql.ResultSet rs) throws PersistenceException, java.sql.SQLException
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.T getValue(java.sql.ResultSet rs) throws PersistenceException, java.sql.SQLException
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.T increment(T value)
value
- value to be incremented.T add(T value, int offset)
value
- Handler instance in which new value will be addedoffset
- Offset location. *void bindValue(java.sql.PreparedStatement stmt, int index, T value) throws java.sql.SQLException
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