| java.lang.Object org.apache.torque.oid.AutoIncrementIdGenerator
AutoIncrementIdGenerator | public class AutoIncrementIdGenerator implements IdGenerator(Code) | | This generator works with databases that have an sql syntax that
allows the retrieval of the last id used to insert a row for a
Connection.
author: John D. McNally version: $Id: AutoIncrementIdGenerator.java 473821 2006-11-11 22:37:25Z tv $ |
Method Summary | |
public BigDecimal | getIdAsBigDecimal(Connection connection, Object keyInfo) Returns the last ID used by this connection.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. | public int | getIdAsInt(Connection connection, Object keyInfo) Returns the last ID used by this connection.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. | public long | getIdAsLong(Connection connection, Object keyInfo) Returns the last ID used by this connection.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. | public String | getIdAsString(Connection connection, Object keyInfo) Returns the last ID used by this connection.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. | final public boolean | isConnectionRequired() A flag to determine whether a Connection is required to
generate an id. | public boolean | isPostInsert() | public boolean | isPriorToInsert() |
AutoIncrementIdGenerator | public AutoIncrementIdGenerator(DB dbAdapter, String name)(Code) | | Creates an IdGenerator which will work with the specified database.
Parameters: dbAdapter - the adapter that knows the correct sql syntax. Parameters: name - The name of the datasource to find the correct schema |
getIdAsBigDecimal | public BigDecimal getIdAsBigDecimal(Connection connection, Object keyInfo) throws Exception(Code) | | Returns the last ID used by this connection.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. A BigDecimal with the last value auto-incremented as aresult of an insert. exception: Exception - Database error. |
getIdAsInt | public int getIdAsInt(Connection connection, Object keyInfo) throws Exception(Code) | | Returns the last ID used by this connection.
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 | public long getIdAsLong(Connection connection, Object keyInfo) throws Exception(Code) | | Returns the last ID used by this connection.
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 | public String getIdAsString(Connection connection, Object keyInfo) throws Exception(Code) | | Returns the last ID used by this connection.
Parameters: connection - A Connection. Parameters: keyInfo - an Object that contains additional info. A String with the last value auto-incremented as aresult of an insert. exception: Exception - Database error. |
isConnectionRequired | final public boolean isConnectionRequired()(Code) | | A flag to determine whether a Connection is required to
generate an id.
a boolean value |
isPostInsert | public boolean isPostInsert()(Code) | | A flag to determine the timing of the id generation
a boolean value |
isPriorToInsert | public boolean isPriorToInsert()(Code) | | A flag to determine the timing of the id generation
a boolean value |
|
|