|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IdGenerator
Interface to be implemented by id generators. It is possible that some implementations might not require all the arguments, for example MySQL will not require a keyInfo Object, while the IDBroker implementation does not require a Connection as it only rarely needs one and retrieves a connection from the Connection pool service only when needed.
Method Summary | |
---|---|
java.math.BigDecimal |
getIdAsBigDecimal(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns an id as a BigDecimal. |
int |
getIdAsInt(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns an id as a primitive int. |
long |
getIdAsLong(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns an id as a primitive long. |
java.lang.String |
getIdAsString(java.sql.Connection connection,
java.lang.Object keyInfo)
Returns an id as a String. |
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 |
Method Detail |
---|
int getIdAsInt(java.sql.Connection connection, java.lang.Object keyInfo) throws java.lang.Exception
getIdAsLong(Connection, Object)
be used instead (due to the
limitted range of this method).
connection
- A Connection.keyInfo
- an Object that contains additional info.
java.lang.Exception
- Database error.long getIdAsLong(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.java.math.BigDecimal getIdAsBigDecimal(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.java.lang.String getIdAsString(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.boolean isPriorToInsert()
boolean
valueboolean isPostInsert()
insert
.boolean isConnectionRequired()
boolean
value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |