public final class SequenceGenerator extends AbstractRDBMSGenerator
"selectto get the next value in the sequence. It is datastore-dependent since there is no RDBMS-independent statement. SequencePoidGenerator works with numbers, so clients using this generator must cast the ID to Long.nextval from dual"
Required user properties
Optional user properties
Modifier and Type | Field and Description |
---|---|
protected String |
sequenceName
Name of the sequence that we are creating values for
|
connection, LOCALISER_RDBMS
Constructor and Description |
---|
SequenceGenerator(String name,
Properties props)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
createRepository()
Method to create the sequence.
|
protected String |
getSequenceName()
Accessor for the sequence name to use (fully qualified with catalog/schema).
|
protected boolean |
repositoryExists()
Method to return if the repository already exists.
|
protected boolean |
requiresRepository()
Indicator for whether the generator requires its own repository.
|
protected org.datanucleus.store.valuegenerator.ValueGenerationBlock |
reserveBlock(long size)
Reserve a block of ids.
|
obtainGenerationBlock, requiresConnection
setConnectionProvider, setStoreManager
protected String sequenceName
public SequenceGenerator(String name, Properties props)
name
- Symbolic name for the generatorprops
- Properties controlling the behaviour of the generatorprotected org.datanucleus.store.valuegenerator.ValueGenerationBlock reserveBlock(long size)
reserveBlock
in class org.datanucleus.store.valuegenerator.AbstractGenerator
size
- Block sizeprotected String getSequenceName()
protected boolean requiresRepository()
requiresRepository
in class org.datanucleus.store.valuegenerator.AbstractGenerator
protected boolean repositoryExists()
repositoryExists
in class org.datanucleus.store.valuegenerator.AbstractGenerator
protected boolean createRepository()
createRepository
in class org.datanucleus.store.valuegenerator.AbstractGenerator
Copyright © 2023. All rights reserved.