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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleSequenceFactory
public SimpleSequenceFactory()
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 persistedds
- 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 servecm
- metadata on the class of the object being persistedds
- 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
Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.