Package io.ebean.config.dbplatform
Class SequenceIdGenerator
- java.lang.Object
-
- io.ebean.config.dbplatform.SequenceIdGenerator
-
- All Implemented Interfaces:
PlatformIdGenerator
- Direct Known Subclasses:
SequenceBatchIdGenerator
,SequenceStepIdGenerator
public abstract class SequenceIdGenerator extends Object implements PlatformIdGenerator
Database sequence based IdGenerator.
-
-
Field Summary
-
Fields inherited from interface io.ebean.config.dbplatform.PlatformIdGenerator
AUTO_UUID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getName()
Returns the sequence name.abstract String
getSql(int batchSize)
boolean
isDbSequence()
Returns true.Object
nextId(Transaction t)
Return the next Id.void
preAllocateIds(int requestSize)
If allocateSize is large load some sequences in a background thread.
-
-
-
Method Detail
-
getName
public String getName()
Returns the sequence name.- Specified by:
getName
in interfacePlatformIdGenerator
-
isDbSequence
public boolean isDbSequence()
Returns true.- Specified by:
isDbSequence
in interfacePlatformIdGenerator
-
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
-
nextId
public Object nextId(Transaction t)
Return the next Id.If a Transaction has been passed in use the Connection from it.
- Specified by:
nextId
in interfacePlatformIdGenerator
-
-