org.datanucleus.store.rdbms.valuegenerator
Class MaxGenerator
java.lang.Object
org.datanucleus.store.valuegenerator.AbstractGenerator
org.datanucleus.store.valuegenerator.AbstractDatastoreGenerator
org.datanucleus.store.rdbms.valuegenerator.AbstractRDBMSGenerator
org.datanucleus.store.rdbms.valuegenerator.MaxGenerator
- All Implemented Interfaces:
- org.datanucleus.store.valuegenerator.ValueGenerator
public class MaxGenerator
- extends AbstractRDBMSGenerator
This generator for Relational Databases uses the "select max(column) from
table" strategy. The block size is limited to 1. MaxPoidGenerator works
with numbers, so clients using this generator must cast the ID to Long *
Required user properties
Optional user properties
|
Field Summary |
protected static org.datanucleus.util.Localiser |
LOCALISER_RDBMS
|
| 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 |
MaxGenerator(java.lang.String name,
java.util.Properties props)
Constructor. |
|
Method Summary |
org.datanucleus.store.valuegenerator.ValueGenerationBlock |
reserveBlock(long size)
Method to reserve a block of identities. |
| 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOCALISER_RDBMS
protected static final org.datanucleus.util.Localiser LOCALISER_RDBMS
MaxGenerator
public MaxGenerator(java.lang.String name,
java.util.Properties props)
- Constructor.
- Parameters:
name - Symbolic name for this generatorprops - Properties defining the behaviour of this generator
reserveBlock
public org.datanucleus.store.valuegenerator.ValueGenerationBlock reserveBlock(long size)
- Method to reserve a block of identities.
Note : Only allocates a single id always.
- Specified by:
reserveBlock in class org.datanucleus.store.valuegenerator.AbstractGenerator
- Parameters:
size - The block size
- Returns:
- The reserved block
Copyright © 2009. All Rights Reserved.