public class SimpleSequenceIdGenerator extends Object implements PlatformIdGenerator
One which batch requests sequence Id's would be better for performance.
AUTO_UUID| Constructor and Description |
|---|
SimpleSequenceIdGenerator(DataSource dataSource,
String sql,
String seqName)
Construct given a dataSource and sql to return the next sequence value.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Return the name of the IdGenerator.
|
boolean |
isDbSequence()
Return true if this is a DB sequence.
|
Object |
nextId(Transaction t)
return the next unique identity value.
|
void |
preAllocateIds(int batchSize)
Is called prior to inserting OneToMany's as an indication that a number of
beans are likely to need id's shortly.
|
public SimpleSequenceIdGenerator(DataSource dataSource, String sql, String seqName)
public String getName()
PlatformIdGeneratorgetName in interface PlatformIdGeneratorpublic boolean isDbSequence()
PlatformIdGeneratorisDbSequence in interface PlatformIdGeneratorpublic void preAllocateIds(int batchSize)
PlatformIdGeneratorCan be used as a performance optimisation to prefetch a number of Id's. Especially when the allocateSize is very large.
preAllocateIds in interface PlatformIdGeneratorpublic Object nextId(Transaction t)
PlatformIdGeneratorNote the transaction passed in can be null.
nextId in interface PlatformIdGeneratorCopyright © 2019. All rights reserved.