public final class SequentialPrimaryKeyGenerator extends Object implements PrimaryKeyGenerator
SequentialPrimaryKeyPersistence
implementation for cluster-safe generation and persistence of primary
keys. This implementation is thread-safe.Constructor and Description |
---|
SequentialPrimaryKeyGenerator(SequentialPrimaryKeyPersistence primaryKeyPersistence,
int blockSize)
Create a new instance that delegates actual primary key generation to the given primary key persistence.
|
Modifier and Type | Method and Description |
---|---|
int |
getBlockSize()
Returns the configured block size.
|
<T> T |
getNextPrimaryKey(Class<T> expectedType)
Generates the next primary key.
|
public SequentialPrimaryKeyGenerator(SequentialPrimaryKeyPersistence primaryKeyPersistence, int blockSize)
primaryKeyPersistence
- the primary key persistence that generates the actual primary keysblockSize
- the number of primary keys to fetch from the primary key persistencepublic int getBlockSize()
public <T> T getNextPrimaryKey(Class<T> expectedType)
getNextPrimaryKey
in interface PrimaryKeyGenerator
T
- the type of the classexpectedType
- the expected type of the keyCopyright © 2010 - 2018 edorasware ag. All Rights Reserved.