Has anyone implemented
ULID id generator? We'd like to use ULID instead of UUID as in the id column for the benefits of ULID being sortable.
Based on ebean
documentation, I'd create custom id generator and define an entity as
class Customer {
@Id @GeneratedValue(generator = "ulid")
byte[] id;
// create getter/setter to convert between ULID and byte[]
..
}
How can I use ULID class directly in entity bean (see below) and have ebean map ULID to corresponding binary data type in database (e.g. bytea for postgres)?
class Customer {
@Id @GeneratedValue(generator = "ulid")
ULID id;
..
}
Buck