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 ClassSequenceFactory

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

All Implemented Interfaces:
  SequenceFactory, Serializable

public class ClassSequenceFactory
extends Object
implements SequenceFactory

`SequenceFactory` implementation that uses a sequence per class to generate numbers. It checks for the extension "sequence" under class-leve metadata. Note that much of the code here is duplicated across `TrueSequenceFactory`. The code is separated for clarity to plug-in developers. Designed as an example for subclassing / re-implementation. Only tested on Oracle. Other databases may require subclassing or re-implementation using this class as a basis.

See Also:
  `SequenceFactory`, `DBDictionaryFactory`, Serialized Form

Field Summary
`static String` | `SEQUENCE_EXT`

Constructor Summary
`ClassSequenceFactory()`

Method Summary
`String` | `getFormat()` Return the MessageFormat String to use as for SQL generation
`long` | `getNext(Class cls, Connector connector)` Get the next sequence from the proper table defined in the metadata.
`String` | `getTableName()` Return the table name to run sequence queries against.
`void` | `setConfiguration(JDBCConfiguration conf, DBDictionary dict)` Set the configuration for this factory; allows access to database connection information, etc.
`void` | `setFormat(String messageFormat)` Set the String used for MessageFormat to generate the sequence selecting SQL.
`void` | `setTableName(String name)` Set the table name to run sequence queries against.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SEQUENCE_EXT

    public static final String SEQUENCE_EXT

Constructor Detail

### ClassSequenceFactory

    public ClassSequenceFactory()

Method Detail

### getTableName

    public String getTableName()

  Return the table name to run sequence queries against.

### setTableName

    public void setTableName(String name)

  Set the table name to run sequence queries against. Defaults to DUAL.
  Parameters:
    `name` - the name of the table

### getFormat

    public String getFormat()

  Return the MessageFormat String to use as for SQL generation

### setFormat

    public void setFormat(String messageFormat)

  Set the String used for MessageFormat to generate the sequence selecting SQL. Should have two placeholders, 0 for the sequence name and 1 for the table name (e.g. dual) Also, it converts $ to spaces to help with auto configuration Defaults to "select {0}.NEXTVAL from {1}"

### 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

  Get the next sequence from the proper table defined in the metadata.
  Specified by:
    `getNext` in interface `SequenceFactory`

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.