com.objectwave.persist.broker
Class SelectAndUpdate
java.lang.Object
|
+--com.objectwave.persist.broker.SelectAndUpdate
- All Implemented Interfaces:
- PrimaryKeyStrategy
- public class SelectAndUpdate
- extends java.lang.Object
- implements PrimaryKeyStrategy
Use a simple strategy for maintaining a primary key. This approach is a
built in race condition.
- Version:
- $Id: SelectAndUpdate.java,v 2.1 2001/06/18 21:03:47 dave_hoag Exp $
- Author:
- dhoag
Constructor Summary |
SelectAndUpdate()
Constructor for the SelectAndUpdate object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SelectAndUpdate
public SelectAndUpdate()
- Constructor for the SelectAndUpdate object
setTableName
public void setTableName(java.lang.String aValue)
- Parameters:
aValue
- The new TableName value
setColumnName
public void setColumnName(java.lang.String aValue)
- Parameters:
aValue
- The new ColumnName value
getTableName
public java.lang.String getTableName()
- Returns:
- The TableName value
getColumnName
public java.lang.String getColumnName()
- Returns:
- The ColumnName value
nextPrimaryKey
public java.lang.Object nextPrimaryKey(RDBBroker broker,
RDBPersistence pObj)
throws java.sql.SQLException,
QueryException
- Select the value from the DB. Increment it by 1. Update the value in the
db.
- Specified by:
nextPrimaryKey
in interface PrimaryKeyStrategy
- Parameters:
broker
- pObj
-
- Returns:
-
- Throws:
java.sql.SQLException
QueryException