Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.4.3 generated on March 27 2003
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      |
      +--com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory

All Implemented Interfaces:
  SequenceFactory, Serializable

Direct Known Subclasses:
  ClassDBSequenceFactory

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.

See Also:
  Serialized Form

Constructor Summary
`DBSequenceFactory()`

Method Summary
`void` | `dropTable(SQLExecutionManager manager)` Drops the sequence table in the DB.
`int` | `getIncrement()` Return the increment to us when updating the sequence table.
`long` | `getNext(Class cls, Connector connector)` Return a unique primary key value for the given class.
`String` | `getTableName()` Return the table name to use to store sequence ids.
`static void` | `main(String[] args)` Usage: java com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory [option]* -action <add | drop | increment>
`void` | `setConfiguration(JDBCConfiguration conf, DBDictionary dict)` 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.
`void` | `setTableName(String name)` Set the table name for storing sequence ids.

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

### getTableName

    public String getTableName()

  Return the table name to use to store sequence ids.

### setTableName

    public void setTableName(String name)

  Set the table name for storing sequence ids. Defaults to JDO_SEQUENCE. Note that this table name will be further altered by the `DBDictionary`

### 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,
                                 DBDictionary dict)

  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,
                        Connector connector)
                 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(SQLExecutionManager manager)
                   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.

  - -properties <properties file>: the path to a Kodo properties file containing information such as the license key and connection data as outlined in `Configuration`; optional
  - -ignoreErrors <true|false>: if false, an exception will will be thrown if the tool encounters any database exceptions; defaults to `false`
  - -<bean property> <value>: all bean properties of the Kodo `JDBCConfiguration` can be set by using their names and supplying a value; for example: `-licenseKey adslfja83r3lkadf`

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

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.4.3 generated on March 27 2003
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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