Class MaxGenerator
- java.lang.Object
-
- org.datanucleus.store.valuegenerator.AbstractGenerator<T>
-
- org.datanucleus.store.valuegenerator.AbstractConnectedGenerator<Long>
-
- org.datanucleus.store.rdbms.valuegenerator.MaxGenerator
-
- All Implemented Interfaces:
org.datanucleus.store.valuegenerator.ValueGenerator<Long>
public class MaxGenerator extends org.datanucleus.store.valuegenerator.AbstractConnectedGenerator<Long>
ValueGenerator for RDBMS that uses the "SELECT MAX(column) FROM TABLE" strategy. The allocation size is limited to 1. This works with numbers, so clients using this generator must cast the ID to Long.
-
-
Field Summary
-
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractConnectedGenerator
connectionProvider, properties
-
Fields inherited from class org.datanucleus.store.valuegenerator.AbstractGenerator
allocationSize, block, initialValue, name, storeMgr
-
Fields inherited from interface org.datanucleus.store.valuegenerator.ValueGenerator
PROPERTY_CATALOG_NAME, PROPERTY_CLASS_NAME, PROPERTY_COLUMN_NAME, PROPERTY_FIELD_NAME, PROPERTY_KEY_CACHE_SIZE, PROPERTY_KEY_DATABASE_CACHE_SIZE, PROPERTY_KEY_INITIAL_VALUE, PROPERTY_KEY_MAX_VALUE, PROPERTY_KEY_MIN_VALUE, PROPERTY_ROOT_CLASS_NAME, PROPERTY_SCHEMA_NAME, PROPERTY_SEQUENCE_NAME, PROPERTY_SEQUENCETABLE_CATALOG, PROPERTY_SEQUENCETABLE_NAME_COLUMN, PROPERTY_SEQUENCETABLE_NEXTVAL_COLUMN, PROPERTY_SEQUENCETABLE_SCHEMA, PROPERTY_SEQUENCETABLE_TABLE, PROPERTY_TABLE_NAME
-
-
Constructor Summary
Constructors Constructor Description MaxGenerator(org.datanucleus.store.StoreManager storeMgr, String name, Properties props)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.datanucleus.store.valuegenerator.AbstractConnectedGenerator.ConnectionPreference
getConnectionPreference()
org.datanucleus.store.valuegenerator.ValueGenerationBlock
reserveBlock(long size)
Method to reserve a block of identities.-
Methods inherited from class org.datanucleus.store.valuegenerator.AbstractConnectedGenerator
setConnectionProvider
-
-
-
-
Constructor Detail
-
MaxGenerator
public MaxGenerator(org.datanucleus.store.StoreManager storeMgr, String name, Properties props)
Constructor.- Parameters:
storeMgr
- StoreManagername
- Symbolic name for this generatorprops
- Properties defining the behaviour of this generator
-
-
Method Detail
-
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 classorg.datanucleus.store.valuegenerator.AbstractGenerator<Long>
- Parameters:
size
- The block size- Returns:
- The reserved block
-
getConnectionPreference
public org.datanucleus.store.valuegenerator.AbstractConnectedGenerator.ConnectionPreference getConnectionPreference()
- Overrides:
getConnectionPreference
in classorg.datanucleus.store.valuegenerator.AbstractConnectedGenerator<Long>
-
-