I save UUID without slashes as varbinary(16) in MySql. I will like to use annotation to map this field in Hibernate. Am I able to do it? Please help.
Here is my mapping:
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid2")
@Column(name = "PRODUCT_ID", unique = true)
private String productId;
Here is my insert:
INSERT INTO `item`
(`ID`,
`TITLE`)
VALUES
(
UNHEX('f4e01440cfd011e39c1a0800200c9a66'),
'Apple'
);
But id become something like ��%14@��%11��%1A%08%00 %0C�f in my code.