java.lang.Object
io.ebean.config.dbplatform.SequenceIdGenerator
io.ebean.config.dbplatform.SequenceBatchIdGenerator
- All Implemented Interfaces:
PlatformIdGenerator
Database sequence based IdGenerator using Sequence Step 1 but batch fetch many sequence values.
-
Field Summary
Fields inherited from class io.ebean.config.dbplatform.SequenceIdGenerator
allocationSize, backgroundExecutor, currentlyBackgroundLoading, dataSource, idList, log, seqName
Fields inherited from interface io.ebean.config.dbplatform.PlatformIdGenerator
AUTO_UUID
-
Constructor Summary
ConstructorDescriptionSequenceBatchIdGenerator
(BackgroundExecutor be, DataSource ds, String seqName, int batchSize) Construct where batchSize is the sequence step size. -
Method Summary
Modifier and TypeMethodDescriptionvoid
preAllocateIds
(int requestSize) If allocateSize is large load some sequences in a background thread.Add the next set of Ids as the next value plus all the following numbers up to the step size.Methods inherited from class io.ebean.config.dbplatform.SequenceIdGenerator
getMoreIds, getName, getSql, isDbSequence, loadInBackground, nextId
-
Constructor Details
-
SequenceBatchIdGenerator
public SequenceBatchIdGenerator(BackgroundExecutor be, DataSource ds, String seqName, int batchSize) Construct where batchSize is the sequence step size.
-
-
Method Details
-
preAllocateIds
public void preAllocateIds(int requestSize) If allocateSize is large load some sequences in a background thread.For example, when inserting a bean with a cascade on a OneToMany with many beans Ebean can call this to ensure .
- Specified by:
preAllocateIds
in interfacePlatformIdGenerator
- Overrides:
preAllocateIds
in classSequenceIdGenerator
-
readIds
Add the next set of Ids as the next value plus all the following numbers up to the step size.- Specified by:
readIds
in classSequenceIdGenerator
- Throws:
SQLException
-