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()
PlatformIdGenerator
getName
in interface PlatformIdGenerator
public boolean isDbSequence()
PlatformIdGenerator
isDbSequence
in interface PlatformIdGenerator
public void preAllocateIds(int batchSize)
PlatformIdGenerator
Can be used as a performance optimisation to prefetch a number of Id's. Especially when the allocateSize is very large.
preAllocateIds
in interface PlatformIdGenerator
public Object nextId(Transaction t)
PlatformIdGenerator
Note the transaction passed in can be null.
nextId
in interface PlatformIdGenerator
Copyright © 2019. All rights reserved.