org.unitils.dbmaintainer.structure.impl
Class DefaultSequenceUpdater

java.lang.Object
  extended by org.unitils.dbmaintainer.util.BaseDatabaseAccessor
      extended by org.unitils.dbmaintainer.structure.impl.DefaultSequenceUpdater
All Implemented Interfaces:
SequenceUpdater, DatabaseAccessing

public class DefaultSequenceUpdater
extends BaseDatabaseAccessor
implements SequenceUpdater

Implementation of SequenceUpdater. All sequences and identity columns that have a value lower than the value defined by PROPKEY_LOWEST_ACCEPTABLE_SEQUENCE_VALUE are set to this value.

Author:
Filip Neven, Tim Ducheyne

Field Summary
protected  long lowestAcceptableSequenceValue
           
static String PROPKEY_LOWEST_ACCEPTABLE_SEQUENCE_VALUE
           
 
Fields inherited from class org.unitils.dbmaintainer.util.BaseDatabaseAccessor
configuration, dbSupports, defaultDbSupport, sqlHandler
 
Constructor Summary
DefaultSequenceUpdater()
           
 
Method Summary
protected  void doInit(Properties configuration)
          Initializes the lowest acceptable sequence value using the given configuration object
 void updateSequences()
          Updates all database sequences and identity columns to a sufficiently high value, so that test data be inserted easily.
 
Methods inherited from class org.unitils.dbmaintainer.util.BaseDatabaseAccessor
getDbSupport, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.unitils.dbmaintainer.util.DatabaseAccessing
init
 

Field Detail

PROPKEY_LOWEST_ACCEPTABLE_SEQUENCE_VALUE

public static final String PROPKEY_LOWEST_ACCEPTABLE_SEQUENCE_VALUE
See Also:
Constant Field Values

lowestAcceptableSequenceValue

protected long lowestAcceptableSequenceValue
Constructor Detail

DefaultSequenceUpdater

public DefaultSequenceUpdater()
Method Detail

doInit

protected void doInit(Properties configuration)
Initializes the lowest acceptable sequence value using the given configuration object

Overrides:
doInit in class BaseDatabaseAccessor
Parameters:
configuration - The config, not null

updateSequences

public void updateSequences()
Updates all database sequences and identity columns to a sufficiently high value, so that test data be inserted easily.

Specified by:
updateSequences in interface SequenceUpdater


Copyright © 2011. All Rights Reserved.