com.interface21.jdbc.core.support
Class OracleSequenceMaxValueIncrementer

java.lang.Object
  |
  +--com.interface21.jdbc.core.support.AbstractDataFieldMaxValueIncrementer
        |
        +--com.interface21.jdbc.core.support.OracleSequenceMaxValueIncrementer
All Implemented Interfaces:
DataFieldMaxValueIncrementer, InitializingBean

public class OracleSequenceMaxValueIncrementer
extends AbstractDataFieldMaxValueIncrementer

Class to retrieve the next value of a given Oracle SEQUENCE If the cacheSize is set then we will retrive that number of values from sequence and then serve the intermediate values without querying the database

Version:
$Id: OracleSequenceMaxValueIncrementer.java,v 1.12 2003/06/19 05:06:25 trisberg Exp $
Author:
Dmitriy Kopylenko, Isabelle Muszynski, Jean-Pierre Pawlak, Thomas Risberg

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
OracleSequenceMaxValueIncrementer()
          Default constructor
OracleSequenceMaxValueIncrementer(javax.sql.DataSource ds, java.lang.String incrementerName)
          Constructor
OracleSequenceMaxValueIncrementer(javax.sql.DataSource ds, java.lang.String incrementerName, boolean prefixWithZero, int padding)
          Constructor
OracleSequenceMaxValueIncrementer(javax.sql.DataSource ds, java.lang.String incrementerName, boolean prefixWithZero, int padding, int cacheSize)
          Constructor
OracleSequenceMaxValueIncrementer(javax.sql.DataSource ds, java.lang.String incrementerName, int cacheSize)
          Constructor
 
Method Summary
protected  double incrementDoubleValue()
          Template method implementation to be provided by concrete subclasses
protected  int incrementIntValue()
          Template method implementation to be provided by concrete subclasses
protected  long incrementLongValue()
          Template method implementation to be provided by concrete subclasses
protected  java.lang.String incrementStringValue()
          Template method implementation to be provided by concrete subclasses
 void setPrefixWithZero(boolean prefixWithZero, int length)
          Sets the prefixWithZero.
 
Methods inherited from class com.interface21.jdbc.core.support.AbstractDataFieldMaxValueIncrementer
afterPropertiesSet, getCacheSize, getColumnName, getDataSource, getIncrementerName, isDirty, nextDoubleValue, nextIntValue, nextLongValue, nextStringValue, nextValue, setCacheSize, setColumnName, setDataSource, setDirty, setIncrementerName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

OracleSequenceMaxValueIncrementer

public OracleSequenceMaxValueIncrementer()
Default constructor

OracleSequenceMaxValueIncrementer

public OracleSequenceMaxValueIncrementer(javax.sql.DataSource ds,
                                         java.lang.String incrementerName)
Constructor
Parameters:
dataSource - the datasource to use
incrementerName - the name of the sequence/table to use

OracleSequenceMaxValueIncrementer

public OracleSequenceMaxValueIncrementer(javax.sql.DataSource ds,
                                         java.lang.String incrementerName,
                                         int cacheSize)
Constructor
Parameters:
ds - the datasource to use
incrementerName - the name of the sequence/table to use
cacheSize - the number of buffered keys

OracleSequenceMaxValueIncrementer

public OracleSequenceMaxValueIncrementer(javax.sql.DataSource ds,
                                         java.lang.String incrementerName,
                                         boolean prefixWithZero,
                                         int padding)
Constructor
Parameters:
ds - the datasource to be used
incrementerName - the name of the sequence/table to use
prefixWithZero - in case of a String return value, should the string be prefixed with zeroes
padding - the length to which the string return value should be padded with zeroes

OracleSequenceMaxValueIncrementer

public OracleSequenceMaxValueIncrementer(javax.sql.DataSource ds,
                                         java.lang.String incrementerName,
                                         boolean prefixWithZero,
                                         int padding,
                                         int cacheSize)
Constructor
Parameters:
ds - the datasource to be used
incrementerName - the name of the sequence/table to use
prefixWithZero - in case of a String return value, should the string be prefixed with zeroes
padding - the length to which the string return value should be padded with zeroes
cacheSize - the number of buffered keys
Method Detail

setPrefixWithZero

public void setPrefixWithZero(boolean prefixWithZero,
                              int length)
Sets the prefixWithZero.
Parameters:
prefixWithZero - The prefixWithZero to set

incrementIntValue

protected int incrementIntValue()
Description copied from class: AbstractDataFieldMaxValueIncrementer
Template method implementation to be provided by concrete subclasses
Overrides:
incrementIntValue in class AbstractDataFieldMaxValueIncrementer
See Also:
AbstractDataFieldMaxValueIncrementer.incrementIntValue()

incrementLongValue

protected long incrementLongValue()
Description copied from class: AbstractDataFieldMaxValueIncrementer
Template method implementation to be provided by concrete subclasses
Overrides:
incrementLongValue in class AbstractDataFieldMaxValueIncrementer
See Also:
AbstractDataFieldMaxValueIncrementer.incrementLongValue()

incrementDoubleValue

protected double incrementDoubleValue()
Description copied from class: AbstractDataFieldMaxValueIncrementer
Template method implementation to be provided by concrete subclasses
Overrides:
incrementDoubleValue in class AbstractDataFieldMaxValueIncrementer
See Also:
AbstractDataFieldMaxValueIncrementer.incrementDoubleValue()

incrementStringValue

protected java.lang.String incrementStringValue()
Description copied from class: AbstractDataFieldMaxValueIncrementer
Template method implementation to be provided by concrete subclasses
Overrides:
incrementStringValue in class AbstractDataFieldMaxValueIncrementer
See Also:
AbstractDataFieldMaxValueIncrementer.incrementStringValue()


Rod Johnson and Spring contributors 2001-2003.