com.objectwave.persist.broker
Class GlobalSequence

java.lang.Object
  |
  +--com.objectwave.persist.broker.GlobalSequence
All Implemented Interfaces:
PrimaryKeyStrategy

public class GlobalSequence
extends java.lang.Object
implements PrimaryKeyStrategy

Use a sequence called GLOBAL_UID_SEQ to generate primary key values.

Version:
$Id: GlobalSequence.java,v 2.1 2002/03/09 15:23:03 dave_hoag Exp $
Author:
dhoag

Field Summary
protected  int currentPkey
           
protected  int pkeyPool
           
 
Constructor Summary
GlobalSequence()
          Constructor for the GlobalSequence object
 
Method Summary
 java.lang.String getSequenceColumnName()
           
 java.lang.String getSequenceTableName()
          When using Oracle, the default of DUAL works just fine - this may be true with other databases, but I have no idea.
 java.lang.Object nextPrimaryKey(RDBBroker broker, RDBPersistence pObj)
          Calls to this method should never return the same value.
 void setSequenceColumnName(java.lang.String aValue)
          When using oracle, the default sequence will be just fine, but you may have reasons of your own to change it.
 void setSequenceTableName(java.lang.String aValue)
          When using Oracle, the default of DUAL works just fine - this may be true with other databases, but I have no idea.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pkeyPool

protected int pkeyPool

currentPkey

protected int currentPkey
Constructor Detail

GlobalSequence

public GlobalSequence()
Constructor for the GlobalSequence object

Method Detail

setSequenceTableName

public void setSequenceTableName(java.lang.String aValue)
When using Oracle, the default of DUAL works just fine - this may be true with other databases, but I have no idea.

Parameters:
aValue - The new SequenceTableName value

setSequenceColumnName

public void setSequenceColumnName(java.lang.String aValue)
When using oracle, the default sequence will be just fine, but you may have reasons of your own to change it.

Parameters:
aValue - The new SequenceColumnName value

getSequenceTableName

public java.lang.String getSequenceTableName()
When using Oracle, the default of DUAL works just fine - this may be true with other databases, but I have no idea.

Returns:
The SequenceTableName value

getSequenceColumnName

public java.lang.String getSequenceColumnName()
Returns:
The SequenceColumnName value

nextPrimaryKey

public java.lang.Object nextPrimaryKey(RDBBroker broker,
                                       RDBPersistence pObj)
                                throws java.sql.SQLException,
                                       QueryException
Description copied from interface: PrimaryKeyStrategy
Calls to this method should never return the same value. When this method is called, the broker assumes the value returned will create a unique primary key value that can identify a unique row in the database.

Specified by:
nextPrimaryKey in interface PrimaryKeyStrategy
Parameters:
broker -
pObj -
Returns:
Throws:
java.sql.SQLException
QueryException