ojb.broker.util.sequence
Class SequenceManagerHighLowImpl

java.lang.Object
  |
  +--ojb.broker.util.sequence.SequenceManagerDefaultImpl
        |
        +--ojb.broker.util.sequence.SequenceManagerHighLowImpl
All Implemented Interfaces:
SequenceManager

public class SequenceManagerHighLowImpl
extends SequenceManagerDefaultImpl

The SequenceManager implementing the generic High / Low algorithm. It reserves a set of keys in an auxiliary table named 'OJB_HL_SEQ' for each class and key field.
The reserved keys are then used one after the other, the SequenceManagerHighLowImpl makes new reservations as needed.

Author:
R Bischof

Field Summary
 
Fields inherited from class ojb.broker.util.sequence.SequenceManagerDefaultImpl
broker
 
Constructor Summary
SequenceManagerHighLowImpl(PersistenceBrokerImpl broker)
          Constructor for the SequenceManagerHighLowImpl object
 
Method Summary
 int getUniqueId(java.lang.Class clazz, java.lang.String fieldName)
          Gets a new uniqueId for the given Class and fieldname
 java.lang.String getUniqueString(java.lang.Class clazz, java.lang.String fieldName)
          Gets a new unique String for the given Class and fieldname
 void setIncrement(int defaultGrabSize)
          Sets the default GrabSize for new Sequences
 
Methods inherited from class ojb.broker.util.sequence.SequenceManagerDefaultImpl
getMaxForExtent, getUniqueLong, getUniqueObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceManagerHighLowImpl

public SequenceManagerHighLowImpl(PersistenceBrokerImpl broker)
Constructor for the SequenceManagerHighLowImpl object

Parameters:
broker - This BrokerImpl is required to look up the initial MAX keys
Method Detail

setIncrement

public void setIncrement(int defaultGrabSize)
Sets the default GrabSize for new Sequences

Parameters:
defaultGrabSize - The new default GrabSize value

getUniqueId

public int getUniqueId(java.lang.Class clazz,
                       java.lang.String fieldName)
                throws PersistenceBrokerException
Gets a new uniqueId for the given Class and fieldname

Specified by:
getUniqueId in interface SequenceManager
Overrides:
getUniqueId in class SequenceManagerDefaultImpl
Parameters:
clazz - The Class to find a key for
fieldName - The field of the class
Returns:
A new unique Id
PersistenceBrokerException

getUniqueString

public java.lang.String getUniqueString(java.lang.Class clazz,
                                        java.lang.String fieldName)
Gets a new unique String for the given Class and fieldname

Specified by:
getUniqueString in interface SequenceManager
Overrides:
getUniqueString in class SequenceManagerDefaultImpl
Parameters:
clazz - The Class to find a key for
fieldName - The field of the class
Returns:
A new unique String


Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04