|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public 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.public 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.public 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.public 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.public boolean isPriorToInsert()
boolean
valuepublic boolean isPostInsert()
insert
.public boolean isConnectionRequired()
boolean
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |