org.jpox.store.rdbms.poid
Class MaxPoidGenerator

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

public class MaxPoidGenerator
extends AbstractRDBMSPoidGenerator

This generator for Relational Databases uses the "select max(column) from table" strategy. The block Poid size is limited to 1. MaxPoidGenerator works with numbers, so clients using this Poid must cast the ID to Long

Properties required for this PoidGenerator:

Version:
$Revision: 1.4 $

Field Summary
protected static Localiser LOCALISER_RDBMS
           
 
Fields inherited from class org.jpox.store.rdbms.poid.AbstractRDBMSPoidGenerator
connection
 
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
MaxPoidGenerator(java.lang.String name, java.util.Properties props)
          Constructor.
 
Method Summary
 PoidBlock reserveBlock(long size)
          Method to reserve a block of identities.
 
Methods inherited from class org.jpox.store.rdbms.poid.AbstractRDBMSPoidGenerator
obtainPoidBlock, requiresConnection
 
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
 
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
Constructor Detail

MaxPoidGenerator

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

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

reserveBlock

public PoidBlock reserveBlock(long size)
Method to reserve a block of identities. Note : Only allocates a single id always.

Specified by:
reserveBlock in class AbstractPoidGenerator
Parameters:
size - The block size
Returns:
The reserved block


Copyright © -2007 . All Rights Reserved.