| org.apache.torque.oid.IdGenerator
All known Subclasses: org.apache.torque.oid.SequenceIdGenerator, org.apache.torque.oid.IDBroker, org.apache.torque.oid.AutoIncrementIdGenerator,
IdGenerator | public interface IdGenerator (Code) | | 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.
author: John D. McNally version: $Id: IdGenerator.java 473821 2006-11-11 22:37:25Z tv $ |
getIdAsBigDecimal | BigDecimal getIdAsBigDecimal(Connection connection, Object keyInfo) throws Exception(Code) | | Returns an id as a BigDecimal.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. A BigDecimal id. exception: Exception - Database error. |
getIdAsInt | int getIdAsInt(Connection connection, Object keyInfo) throws Exception(Code) | | Returns an id as a primitive int. If you use numeric
identifiers, it's suggested that
IdGenerator.getIdAsLong(Connection,Object) be used instead (due to the
limitted range of this method).
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. An int with the value for the id. exception: Exception - Database error. |
getIdAsLong | long getIdAsLong(Connection connection, Object keyInfo) throws Exception(Code) | | Returns an id as a primitive long.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. A long with the value for the id. exception: Exception - Database error. |
getIdAsString | String getIdAsString(Connection connection, Object keyInfo) throws Exception(Code) | | Returns an id as a String.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. A String id exception: Exception - Database error. |
isConnectionRequired | boolean isConnectionRequired()(Code) | | A flag to determine whether a Connection is required to
generate an id.
a boolean value |
isPostInsert | boolean isPostInsert()(Code) | | A flag to determine the timing of the id generation
Whether id is availble post-insert . |
isPriorToInsert | boolean isPriorToInsert()(Code) | | A flag to determine the timing of the id generation
a boolean value |
|
|