SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

kodo.jdbc.schema
Class SimpleSequenceFactory

java.lang.Object
  |
  +--kodo.jdbc.schema.SimpleSequenceFactory
All Implemented Interfaces:
SequenceFactory

public class SimpleSequenceFactory
extends Object
implements SequenceFactory

Very simple sequence factory that uses a static counter initialized to the current time to create unique id values.


Constructor Summary
SimpleSequenceFactory()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSequenceFactory

public SimpleSequenceFactory()
Method Detail

addSchema

public void addSchema(ClassMapping mapping,
                      SchemaGroup group)
Description copied from interface: SequenceFactory
Add any tables, etc needed by this factory for the given mapping to the given schema group, if they do not exist already.
Specified by:
addSchema in interface SequenceFactory

getNext

public long getNext(ClassMapping mapping,
                    DataSource ds)
             throws Exception
Description copied from interface: SequenceFactory
Return a unique primary key value.
Specified by:
getNext in interface SequenceFactory
Following copied from interface: kodo.jdbc.schema.SequenceFactory
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)
Description copied from interface: SequenceFactory
Ensures that this sequence factory has sufficient capacity readily available to provide count new sequence values.
Specified by:
ensureCapacity in interface SequenceFactory
Following copied from interface: kodo.jdbc.schema.SequenceFactory
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

SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

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