|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.torque.oid.AutoIncrementIdGenerator
This generator works with databases that have an sql syntax that allows the retrieval of the last id used to insert a row for a Connection.
| Field Summary | |
private DB |
dbAdapter
the adapter that knows the correct sql syntax |
| Constructor Summary | |
AutoIncrementIdGenerator(DB adapter)
Creates an IdGenerator which will work with the specified database. |
|
| Method Summary | |
java.math.BigDecimal |
getIdAsBigDecimal(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns the last ID used by this connection. |
int |
getIdAsInt(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns the last ID used by this connection. |
long |
getIdAsLong(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns the last ID used by this connection. |
java.lang.String |
getIdAsString(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns the last ID used by this connection. |
private com.workingdogs.village.Value |
getIdAsVillageValue(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns the last ID used by this connection. |
boolean |
isConnectionRequired()
A flag to determine whether a Connection is required to generate an id. |
boolean |
isPostInsert()
A flag to determine the timing of the id generation |
boolean |
isPriorToInsert()
A flag to determine the timing of the id generation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private DB dbAdapter
| Constructor Detail |
public AutoIncrementIdGenerator(DB adapter)
adapter - the adapter that knows the correct sql syntax.| Method Detail |
public int getIdAsInt(java.sql.Connection connection,
java.lang.Object keyInfo)
throws java.lang.Exception
getIdAsInt in interface IdGeneratorconnection - A Connection.keyInfo - an Object that contains additional info.
java.lang.Exception - Database error.
public long getIdAsLong(java.sql.Connection connection,
java.lang.Object keyInfo)
throws java.lang.Exception
getIdAsLong in interface IdGeneratorconnection - A Connection.keyInfo - an Object that contains additional info.
java.lang.Exception - Database error.
public java.math.BigDecimal getIdAsBigDecimal(java.sql.Connection connection,
java.lang.Object keyInfo)
throws java.lang.Exception
getIdAsBigDecimal in interface IdGeneratorconnection - A Connection.keyInfo - an Object that contains additional info.
java.lang.Exception - Database error.
public java.lang.String getIdAsString(java.sql.Connection connection,
java.lang.Object keyInfo)
throws java.lang.Exception
getIdAsString in interface IdGeneratorconnection - A Connection.keyInfo - an Object that contains additional info.
java.lang.Exception - Database error.public boolean isPriorToInsert()
isPriorToInsert in interface IdGeneratorboolean valuepublic boolean isPostInsert()
isPostInsert in interface IdGeneratorboolean valuepublic final boolean isConnectionRequired()
isConnectionRequired in interface IdGeneratorboolean value
private com.workingdogs.village.Value getIdAsVillageValue(java.sql.Connection connection,
java.lang.Object keyInfo)
throws java.lang.Exception
connection - A Connection.keyInfo - an Object that contains additional info.
java.lang.Exception - Database error.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||