org.jpox.store.rdbms.poid
Class AbstractRDBMSPoidGenerator

java.lang.Object
  extended byorg.jpox.store.poid.AbstractPoidGenerator
      extended byorg.jpox.store.poid.AbstractDatastorePoidGenerator
          extended byorg.jpox.store.rdbms.poid.AbstractRDBMSPoidGenerator
All Implemented Interfaces:
PoidGenerator, javax.jdo.datastore.Sequence
Direct Known Subclasses:
DatastoreUUIDHexPoidGenerator, MaxPoidGenerator, SequencePoidGenerator, SequenceTablePoidGenerator

public abstract class AbstractRDBMSPoidGenerator
extends AbstractDatastorePoidGenerator

Abstract representation of a PoidGenerator for RDBMS datastores. Builds on the base AbstractPoidGenerator, and providing datastore connection and StoreManager information.

Version:
$Revision: 1.5 $

Field Summary
protected  java.sql.Connection connection
          Connection to the datastore.
protected static Localiser LOCALISER_RDBMS
          Localiser for messages specific to RDBMS generators.
 
Fields inherited from class org.jpox.store.poid.AbstractDatastorePoidGenerator
connectionProvider, storeMgr
 
Fields inherited from class org.jpox.store.poid.AbstractPoidGenerator
defaultBlockSize, LOCALISER, name, poidBlock, properties
 
Constructor Summary
AbstractRDBMSPoidGenerator(java.lang.String name, java.util.Properties props)
          Constructor.
 
Method Summary
protected  PoidBlock obtainPoidBlock(int number)
          Get a new PoidBlock with the specified number of ids.
 boolean requiresConnection()
          Method to reply if the generator requires a connection.
 
Methods inherited from class org.jpox.store.poid.AbstractDatastorePoidGenerator
setConnectionProvider, setStoreManager
 
Methods inherited from class org.jpox.store.poid.AbstractPoidGenerator
allocate, createRepository, current, currentValue, getName, next, nextValue, obtainPoidBlock, requiresRepository, reserveBlock, reserveBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER_RDBMS

protected static final Localiser LOCALISER_RDBMS
Localiser for messages specific to RDBMS generators.


connection

protected java.sql.Connection connection
Connection to the datastore.

Constructor Detail

AbstractRDBMSPoidGenerator

public AbstractRDBMSPoidGenerator(java.lang.String name,
                                  java.util.Properties props)
Constructor.

Parameters:
name - Symbolic name for the generator
props - Properties controlling the behaviour of the generator
Method Detail

requiresConnection

public boolean requiresConnection()
Method to reply if the generator requires a connection.

Returns:
Whether a connection is required.

obtainPoidBlock

protected PoidBlock obtainPoidBlock(int number)
Get a new PoidBlock with the specified number of ids.

Overrides:
obtainPoidBlock in class AbstractPoidGenerator
Parameters:
number - The number of additional ids required
Returns:
the PoidBlock


Copyright © -2007 . All Rights Reserved.