org.datanucleus.store.rdbms.valuegenerator
Class AbstractRDBMSGenerator

java.lang.Object
  extended by org.datanucleus.store.valuegenerator.AbstractGenerator
      extended by org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator
          extended by org.datanucleus.store.rdbms.valuegenerator.AbstractRDBMSGenerator
All Implemented Interfaces:
org.datanucleus.store.valuegenerator.ValueGenerator
Direct Known Subclasses:
DatastoreUUIDHexGenerator, MaxGenerator, SequenceGenerator, TableGenerator

public abstract class AbstractRDBMSGenerator
extends org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator

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


Field Summary
protected  org.datanucleus.ManagedConnection connection
          Connection to the datastore.
protected static org.datanucleus.util.Localiser LOCALISER_RDBMS
          Localiser for messages specific to RDBMS generators.
 
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator
connectionProvider, storeMgr
 
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocationSize, block, initialValue, LOCALISER, name, properties, repositoryExists
 
Constructor Summary
AbstractRDBMSGenerator(java.lang.String name, java.util.Properties props)
          Constructor.
 
Method Summary
protected  org.datanucleus.store.valuegenerator.ValueGenerationBlock obtainGenerationBlock(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.datanucleus.store.valuegenerator.AbstractDatastoreGenerator
setConnectionProvider, setStoreManager
 
Methods inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocate, createRepository, current, currentValue, getName, getStorageClass, next, nextValue, obtainGenerationBlock, repositoryExists, 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 org.datanucleus.util.Localiser LOCALISER_RDBMS
Localiser for messages specific to RDBMS generators.


connection

protected org.datanucleus.ManagedConnection connection
Connection to the datastore.

Constructor Detail

AbstractRDBMSGenerator

public AbstractRDBMSGenerator(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.

obtainGenerationBlock

protected org.datanucleus.store.valuegenerator.ValueGenerationBlock obtainGenerationBlock(int number)
Get a new PoidBlock with the specified number of ids.

Overrides:
obtainGenerationBlock in class org.datanucleus.store.valuegenerator.AbstractGenerator
Parameters:
number - The number of additional ids required
Returns:
the PoidBlock


Copyright © 2009. All Rights Reserved.