Package io.ebeaninternal.server.idgen
Class UuidV4IdGenerator
- java.lang.Object
-
- io.ebeaninternal.server.idgen.UuidV4IdGenerator
-
- All Implemented Interfaces:
PlatformIdGenerator
public class UuidV4IdGenerator extends Object implements PlatformIdGenerator
IdGenerator for java util UUID. This generator generates a 60bit random UUID according to https://tools.ietf.org/html/rfc4122.html#section-4.4 Use this generator if you want truly random UUIDs
-
-
Field Summary
Fields Modifier and Type Field Description static UuidV4IdGenerator
INSTANCE
-
Fields inherited from interface io.ebean.config.dbplatform.PlatformIdGenerator
AUTO_UUID
-
-
Constructor Summary
Constructors Constructor Description UuidV4IdGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Returns "uuid".boolean
isDbSequence()
Returns false.Object
nextId(Transaction t)
Return UUID from UUID.randomUUID();void
preAllocateIds(int allocateSize)
Ignored for UUID as not required as a performance optimisation.
-
-
-
Field Detail
-
INSTANCE
public static final UuidV4IdGenerator INSTANCE
-
-
Constructor Detail
-
UuidV4IdGenerator
public UuidV4IdGenerator()
-
-
Method Detail
-
nextId
public Object nextId(Transaction t)
Return UUID from UUID.randomUUID();- Specified by:
nextId
in interfacePlatformIdGenerator
-
getName
public String getName()
Returns "uuid".- Specified by:
getName
in interfacePlatformIdGenerator
-
isDbSequence
public boolean isDbSequence()
Returns false.- Specified by:
isDbSequence
in interfacePlatformIdGenerator
-
preAllocateIds
public void preAllocateIds(int allocateSize)
Ignored for UUID as not required as a performance optimisation.- Specified by:
preAllocateIds
in interfacePlatformIdGenerator
-
-