|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.torque.oid.SequenceIdGenerator
This generator works with databases that have an sql syntax for getting an id prior to inserting a row into the database.
Field Summary | |
private DB |
dbAdapter
the adapter that knows the correct sql syntax |
private static org.apache.commons.logging.Log |
log
The log. |
Constructor Summary | |
SequenceIdGenerator(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)
Retrieves an id as a BigDecimal. |
int |
getIdAsInt(java.sql.Connection connection,
java.lang.Object keyInfo)
Retrieves an id as an int. |
long |
getIdAsLong(java.sql.Connection connection,
java.lang.Object keyInfo)
Retrieves an id as an long. |
java.lang.String |
getIdAsString(java.sql.Connection connection,
java.lang.Object keyInfo)
Retrieves an id as an String. |
private com.workingdogs.village.Value |
getIdAsVillageValue(java.sql.Connection connection,
java.lang.Object keyInfo)
Retrieves an id as a Village Value. |
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 static org.apache.commons.logging.Log log
private DB dbAdapter
Constructor Detail |
public SequenceIdGenerator(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 IdGenerator
connection
- 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 IdGenerator
connection
- 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 IdGenerator
connection
- 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 IdGenerator
connection
- A Connection.keyInfo
- an Object that contains additional info.
java.lang.Exception
- Database error.public boolean isPriorToInsert()
isPriorToInsert
in interface IdGenerator
boolean
valuepublic boolean isPostInsert()
isPostInsert
in interface IdGenerator
boolean
valuepublic boolean isConnectionRequired()
isConnectionRequired
in interface IdGenerator
boolean
valueprivate 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 |