public class ULIDKeyGenerator extends Object implements IKeyGenerator
特点: 1、保证 id 生成的顺序为时间顺序,越往后生成的 ID 值越大; 2、可以按照生成的时间进行排序,而不需要全局协调; 3、生成速度快;
参考:Sequence
| Constructor and Description |
|---|
ULIDKeyGenerator() |
| Modifier and Type | Method and Description |
|---|---|
Object |
generate(Object entity,
String keyColumn) |
String |
nextId()
生成一个 ULID
|
String |
nextMonotonicId()
生成一个严格单调的 ULID
|
Copyright © 2024. All rights reserved.