如果要将String用作数据库密钥,则需要使用UUID自动生成密钥。像这样:
@Id @GeneratedValue(generator="system-uuid")@GenericGenerator(name="system-uuid", strategy = "uuid")private String myId;

如果要将String用作数据库密钥,则需要使用UUID自动生成密钥。像这样:
@Id @GeneratedValue(generator="system-uuid")@GenericGenerator(name="system-uuid", strategy = "uuid")private String myId;