Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.jdbc.schema
Interface SequenceFactory

All Known Implementing Classes:
  ClassSequenceFactory, DBSequenceFactory, SimpleSequenceFactory

public interface SequenceFactory

An implementation of the SequenceFactory interface is used to generate unique primary key values for newly persisted JDO instances. Multiple sequence factories may be used during the lifetime of a JDO application. Most sequence factories will probably implement `Configurable` to receive the system configuration on construction.

Method Summary
`void` | `addSchema(ClassMapping mapping, SchemaGroup group)` Add any tables, etc needed by this factory for the given mapping to the given schema group, if they do not exist already.
`boolean` | `ensureCapacity(int count, ClassMapping cm, DataSource ds)` Ensures that this sequence factory has sufficient capacity readily available to provide `count` new sequence values.
`long` | `getNext(ClassMapping mapping, DataSource ds)` Return a unique primary key value.

Method Detail

### addSchema

    public void addSchema(ClassMapping mapping,
                          SchemaGroup group)

  Add any tables, etc needed by this factory for the given mapping to the given schema group, if they do not exist already.

### getNext

    public long getNext(ClassMapping mapping,
                        DataSource ds)
                 throws Exception

  Return a unique primary key value.
  Parameters:
    `mapping` - metadata on the class of the object being persisted
    `ds` - the data source from which to obtain database connections, if any are needed

### ensureCapacity

    public boolean ensureCapacity(int count,
                                  ClassMapping cm,
                                  DataSource ds)
                           throws Exception

  Ensures that this sequence factory has sufficient capacity readily available to provide `count` new sequence values.
  Parameters:
    `count` - number of sequence values to attempt to serve
    `cm` - metadata on the class of the object being persisted
    `ds` - the data source from which to obtain database connections, if any are needed
  Returns:
    `true` if the factory can service `count` requests without returning to the datastore; else `false`
  Since:
    3.1.0

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 3.4.1 generated on May 30 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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