According to the documentation, the following usage is deprecated:
@GenericGenerator(
name = "UUID",
strategy = "org.hibernate.id.UUIDGenerator"
)
One shall use the new type()
! But how can I transform my above statement to do the same with the type()
? Just providing the hibernate UUIDGenerator doesn't work.
strategy
is a string,type
is a class. Have you triedtype = org.hibernate.id.UUIDGenerator.class
? – Payee@org.hibernate.annotations.UuidGenerator
or@GenericGenerator(name = "UUID", type = org.hibernate.id.uuid.UuidGenerator.class)
– Eductive@GenericGenerator(name = "UUID", type = org.hibernate.id.uuid.UuidGenerator.class)
and got:org.hibernate.MappingException: Could not instantiate id generator
for all classes using your new approach? – Tirrell