- java.lang.Object
-
- io.ebean.config.dbplatform.SequenceIdGenerator
-
- io.ebean.config.dbplatform.SequenceBatchIdGenerator
-
- All Implemented Interfaces:
PlatformIdGenerator
public abstract class SequenceBatchIdGenerator extends SequenceIdGenerator
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
Constructors Constructor Description SequenceBatchIdGenerator(BackgroundExecutor be, DataSource ds, String seqName, int batchSize)Construct where batchSize is the sequence step size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpreAllocateIds(int requestSize)If allocateSize is large load some sequences in a background thread.protected List<Long>readIds(ResultSet resultSet, int loadSize)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 Detail
-
SequenceBatchIdGenerator
public SequenceBatchIdGenerator(BackgroundExecutor be, DataSource ds, String seqName, int batchSize)
Construct where batchSize is the sequence step size.
-
-
Method Detail
-
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:
preAllocateIdsin interfacePlatformIdGenerator- Overrides:
preAllocateIdsin classSequenceIdGenerator
-
readIds
protected List<Long> readIds(ResultSet resultSet, int loadSize) throws SQLException
Add the next set of Ids as the next value plus all the following numbers up to the step size.- Specified by:
readIdsin classSequenceIdGenerator- Throws:
SQLException
-
-