ULID id generator

92 views
Skip to first unread message

buck...@gmail.com

unread,
Jun 19, 2021, 3:39:13 AM6/19/21
to Ebean ORM
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  
Reply all
Reply to author
Forward
0 new messages