@Target({TYPE,METHOD,FIELD})
@Retention(RUNTIME)
@Repeatable(UuidGenerators.class)
public @interface UuidGenerator
Defines a primary key generator that may be
referenced by name when a generator element is specified for
the GeneratedValue annotation.
A UUID generator may be specified on the entity class or on the primary key field or property.
The scope of the generator name is global to the persistence unit (across all generator types).
Example:
@Entity
public class Employee {
...
@UuidGenerator(name="uuid")
@Id
@GeneratedValue(generator="uuid")
int id;
...
}
- Author:
- James Sutherland
-
Required Element Summary
Required Elements
-
Element Details
-
name
String nameThe name of the UUID generator, names must be unique for the persistence unit.
-