|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.castor.cpa.persistence.sql.keygen.typehandler.KeyGeneratorTypeHandlerLong
public final class KeyGeneratorTypeHandlerLong
Class implementing the KeyGeneratorTypeHandler for Long type.
| Constructor Summary | |
|---|---|
KeyGeneratorTypeHandlerLong(boolean fail)
Construct an type handler for long values. |
|
KeyGeneratorTypeHandlerLong(boolean fail,
int allocationSize)
|
|
| Method Summary | |
|---|---|
java.lang.Long |
add(java.lang.Long 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.lang.Long value)
Binds the value in the sql preparedstatement at the provided index location. |
java.lang.Long |
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.lang.Long |
getValue(java.sql.ResultSet rs)
Reads the resultset and return the extracted typehandler value from the resultset. |
java.lang.Long |
increment(java.lang.Long 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 KeyGeneratorTypeHandlerLong(boolean fail)
fail - true if the type handler should fail when current row of the
record set is not valid, false otherwise.
public KeyGeneratorTypeHandlerLong(boolean fail,
int allocationSize)
| Method Detail |
|---|
public java.lang.Long getNextValue(java.sql.ResultSet rs)
throws PersistenceException,
java.sql.SQLException
getNextValue in interface KeyGeneratorTypeHandler<java.lang.Long>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.lang.Long getValue(java.sql.ResultSet rs)
throws PersistenceException,
java.sql.SQLException
getValue in interface KeyGeneratorTypeHandler<java.lang.Long>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,
java.sql.SQLException - If database error occurs.public java.lang.Long increment(java.lang.Long value)
increment in interface KeyGeneratorTypeHandler<java.lang.Long>value - value to be incremented.
public java.lang.Long add(java.lang.Long value,
int offset)
add in interface KeyGeneratorTypeHandler<java.lang.Long>value - Handler instance in which new value will be addedoffset - Offset location. *
public void bindValue(java.sql.PreparedStatement stmt,
int index,
java.lang.Long value)
throws java.sql.SQLException
bindValue in interface KeyGeneratorTypeHandler<java.lang.Long>stmt - A SQL PreparedStatement.index - Index location for binding parameter to statement.value - Value to be binded
java.sql.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 | |||||||