io.ebeaninternal.server.idgen.UuidIdGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.server.idgen;
import io.ebean.Transaction;
import io.ebean.config.dbplatform.PlatformIdGenerator;
import java.util.UUID;
/**
* IdGenerator for java util UUID.
*/
public class UuidIdGenerator implements PlatformIdGenerator {
public static final UuidIdGenerator INSTANCE = new UuidIdGenerator();
/**
* Return UUID from UUID.randomUUID();
*/
public Object nextId(Transaction t) {
return UUID.randomUUID();
}
/**
* Returns "uuid".
*/
public String getName() {
return "uuid";
}
/**
* Returns false.
*/
public boolean isDbSequence() {
return false;
}
/**
* Ignored for UUID as not required as a performance optimisation.
*/
public void preAllocateIds(int allocateSize) {
// ignored
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy