org.apache.ojb.broker.util.sequence
Class SequenceManagerInMemoryImpl

java.lang.Object
  extended by org.apache.ojb.broker.util.sequence.AbstractSequenceManager
      extended by org.apache.ojb.broker.util.sequence.SequenceManagerInMemoryImpl
All Implemented Interfaces:
SequenceManager

public class SequenceManagerInMemoryImpl
extends AbstractSequenceManager

Very fast in memory sequence manager implementation, only the first time an id was requested for a class, the manager query the database for the max id in requested column - all following request were performed in memory.

Limitations:

Implementation configuration properties:

Property Key Property Values
seq.start Set the start index of used sequences (e.g. set 100000, id generation starts with 100001). Default start index is 1.
autoNaming Default was 'true'. If set 'true' OJB try to build a sequence name automatic if none found in field-descriptor and set this generated name as sequence-name in field-descriptor. If set 'false' OJB throws an exception if none sequence name was found in field-descriptor.
sequenceStart Deprecated, use property 'seq.start'. Set the start index of used sequences (e.g. set 100000, id generation starts with 100001). Default start index is 1.



Version:
$Id: SequenceManagerInMemoryImpl.java,v 1.1 2007-08-24 22:17:29 ewestfal Exp $
Author:
Armin Waibel
See Also:
SequenceManager, SequenceManagerFactory, SequenceManagerHelper

Field Summary
protected static Map sequencesDBMap
           
 
Fields inherited from class org.apache.ojb.broker.util.sequence.AbstractSequenceManager
GLOBAL_SEQUENCE_NAME, PROPERTY_AUTO_NAMING
 
Constructor Summary
SequenceManagerInMemoryImpl(PersistenceBroker broker)
           
 
Method Summary
protected  long getUniqueLong(FieldDescriptor field)
          returns a unique long value for field.
protected  void removeSequence(String sequenceName)
          Remove the sequence for given sequence name.
 
Methods inherited from class org.apache.ojb.broker.util.sequence.AbstractSequenceManager
afterStore, calculateSequenceName, getBrokerForClass, getConfigurationProperties, getConfigurationProperty, getPlatform, getUniqueValue, setConfigurationProperties, setConfigurationProperty, setReferenceFKs, useAutoNaming
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sequencesDBMap

protected static Map sequencesDBMap
Constructor Detail

SequenceManagerInMemoryImpl

public SequenceManagerInMemoryImpl(PersistenceBroker broker)
Method Detail

getUniqueLong

protected long getUniqueLong(FieldDescriptor field)
                      throws SequenceManagerException
Description copied from class: AbstractSequenceManager
returns a unique long value for field. the returned number is unique accross all tables in the extent of clazz.

Specified by:
getUniqueLong in class AbstractSequenceManager
Throws:
SequenceManagerException

removeSequence

protected void removeSequence(String sequenceName)
Remove the sequence for given sequence name.

Parameters:
sequenceName - Name of the sequence to remove.


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.