|
||||||||||
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 | |
---|---|
BigDecimal |
getIdAsBigDecimal(Connection connection,
Object keyInfo)
Returns an id as a BigDecimal. |
int |
getIdAsInt(Connection connection,
Object keyInfo)
Returns an id as a primitive int. |
long |
getIdAsLong(Connection connection,
Object keyInfo)
Returns an id as a primitive long. |
String |
getIdAsString(Connection connection,
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(Connection connection, Object keyInfo) throws TorqueException
getIdAsLong(Connection, Object)
be used instead (due to the
limited range of this method).
connection
- The database connection to use.keyInfo
- an Object that contains additional info.
TorqueException
- if a Database error occurs.long getIdAsLong(Connection connection, Object keyInfo) throws TorqueException
connection
- The database connection to use.keyInfo
- an Object that contains additional info.
TorqueException
- if a Database error occurs.BigDecimal getIdAsBigDecimal(Connection connection, Object keyInfo) throws TorqueException
connection
- The database connection to use.keyInfo
- an Object that contains additional info.
TorqueException
- if a Database error occurs.String getIdAsString(Connection connection, Object keyInfo) throws TorqueException
connection
- The database connection to use.keyInfo
- an Object that contains additional info.
TorqueException
- if a Database error occurs.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 |