I\'m using my uuid as following:
@Id
@GeneratedValue(generator = \"uuid\")
@GenericGenerator(name = \"uuid\", strategy = \"uuid\")
@Column(name = \"uuid\", u
This will use UUID v4 and the auto generated uuid will be stored in the column as usual varchar(36):
@Id
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(length = 36)
private String uuid;
This should have some performance impact:
BINARY(16)java.lang.String instance consumes more memory than java.util.UUID: 112 bytes for UUID as string versus 32 bytes (i.e. two longs + obj header) for UUID.But it's much more easier to work with string'ed UUID - easier to write queries and you can see the contents of the table.
Tested on Hibernate 5.3