The Spring Data JPA primary key uses the UUID policy

@Id
@GeneratedValue(generator="system_uuid")
@GenericGenerator(name="system_uuid",strategy="uuid")
private String id;
Copy the code