SolarMetric Kodo JDO Enterprise Edition 2.3.1 generated on August 20 2002

com.solarmetric.kodo.impl.jdbc.schema
Class DBSequenceFactory

java.lang.Object
  |
  +--com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory
All Implemented Interfaces:
SequenceFactory, Serializable

public class DBSequenceFactory
extends Object
implements SequenceFactory

SequenceFactory implementation that uses a database table for sequence number generation. The table is automatically created if not already present.

Author:
Abe White
See Also:
Serialized Form

Constructor Summary
DBSequenceFactory()
           
 
Method Summary
 void dropTable()
          Drops the sequence table in the DB.
 int getIncrement()
          Return the increment to us when updating the sequence table.
 long getNext(Class cls)
          Return a unique primary key value for the given class.
static void main(String[] args)
          Usage: java com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory [option]* -action <add | drop | increment>
 void setConfiguration(JDBCConfiguration conf)
          Set the configuration for this factory; allows access to database connection information, etc.
 void setIncrement(int inc)
          Set the increment to use when updating the sequence table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSequenceFactory

public DBSequenceFactory()
Method Detail

getIncrement

public int getIncrement()
Return the increment to us when updating the sequence table. Sequence numbers will be grabbed in blocks of this value to reduce the number of transactions that must be performed on the sequence table.

setIncrement

public void setIncrement(int inc)
Set the increment to use when updating the sequence table. Defaults to 50, meaning a transaction has to take place on the sequence table only every 50 new objects created.

setConfiguration

public void setConfiguration(JDBCConfiguration conf)
Description copied from interface: SequenceFactory
Set the configuration for this factory; allows access to database connection information, etc.
Specified by:
setConfiguration in interface SequenceFactory

getNext

public long getNext(Class cls)
             throws SQLException
Description copied from interface: SequenceFactory
Return a unique primary key value for the given class.
Specified by:
getNext in interface SequenceFactory

dropTable

public void dropTable()
               throws SQLException
Drops the sequence table in the DB.

main

public static void main(String[] args)
                 throws SQLException

Usage: java com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory [option]* -action <add | drop | increment>

Where the following options are recognized.

If the license key is not specified otherwise, Kodo will check for default preference files with license keys as outlined in DefaultConfiguration.


SolarMetric Kodo JDO Enterprise Edition 2.3.1 generated on August 20 2002

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.