Package io.ebean.config.dbplatform
Class SequenceBatchIdGenerator
- java.lang.Object
-
- io.ebean.config.dbplatform.SequenceIdGenerator
-
- io.ebean.config.dbplatform.SequenceBatchIdGenerator
-
- All Implemented Interfaces:
PlatformIdGenerator
- Direct Known Subclasses:
DB2SequenceIdGenerator
,H2SequenceIdGenerator
,OracleSequenceIdGenerator
,PostgresSequenceIdGenerator
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 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 void
preAllocateIds(int requestSize)
If allocateSize is large load some sequences in a background thread.-
Methods inherited from class io.ebean.config.dbplatform.SequenceIdGenerator
getName, getSql, isDbSequence, 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:
preAllocateIds
in interfacePlatformIdGenerator
- Overrides:
preAllocateIds
in classSequenceIdGenerator
-
-