mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-03 08:24:23 +00:00
#919 - io.ebean package initial
This commit is contained in:
1 parent
5821dc96b9
commit
971e2dc91b
2134 files changed
+10721
-8652
No files matched your search
@@ -0,0 +1,43 @@
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
|
||||
<TITLE>Id Generation</TITLE>
|
||||
</HEAD>
|
||||
<Body BGCOLOR="#ffffff">
|
||||
Id Generation (Sequences, UUIDGen etc)
|
||||
|
||||
|
||||
</Body>
|
||||
</HTML>
|
||||
Reference in new issue
Block a user