org.jpox.store.rdbms.poid
Class SequencePoidGenerator
java.lang.Object
org.jpox.store.poid.AbstractPoidGenerator
org.jpox.store.poid.AbstractDatastorePoidGenerator
org.jpox.store.rdbms.poid.AbstractRDBMSPoidGenerator
org.jpox.store.rdbms.poid.SequencePoidGenerator
- All Implemented Interfaces:
- PoidGenerator, javax.jdo.datastore.Sequence
- public final class SequencePoidGenerator
- extends AbstractRDBMSPoidGenerator
This generator Sequence uses the "select .nextval from dual",
"SELECT nextval('')" strategy.
It's recommended to use this generator in databases supporting sequences.
SequencePoidGenerator works with numbers, so clients using this Poid must cast the ID to Long
Required properties
- sequence-name - the sequence name
Optional properties
- key-cache-size - number of unique identifiers to cache
- key-min-value - determines the minimum value a sequence can generate
- key-max-value - determines the maximum value a sequence can generate
- key-start-with - the initial value for the sequence
- key-increment-by - specifies which value is added to the current
sequence value to create a new value (default is 1)
- key-database-cache-size - specifies how many sequence numbers are to be
preallocated and stored in memory for faster access
- Version:
- $Revision: 1.5 $
Constructor Summary |
SequencePoidGenerator(java.lang.String name,
java.util.Properties props)
Constructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOCALISER_RDBMS
protected static final Localiser LOCALISER_RDBMS
SequencePoidGenerator
public SequencePoidGenerator(java.lang.String name,
java.util.Properties props)
- Constructor.
- Parameters:
name
- Symbolic name for the generatorprops
- Properties controlling the behaviour of the generator
reserveBlock
protected PoidBlock reserveBlock(long size)
- Reserve a block of ids.
- Specified by:
reserveBlock
in class AbstractPoidGenerator
- Parameters:
size
- Block size
- Returns:
- The reserved block
requiresRepository
protected boolean requiresRepository()
- Indicator for whether the generator requires its own repository.
This class needs a repository so returns true.
- Overrides:
requiresRepository
in class AbstractPoidGenerator
- Returns:
- Whether a repository is required.
createRepository
protected boolean createRepository()
- Method to create the sequence.
- Overrides:
createRepository
in class AbstractPoidGenerator
- Returns:
- Whether it was created successfully.
Copyright © -2007 . All Rights Reserved.