SSH自动生成主键
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid.hex")
@Column(name = "PAYNO")
public String getPayNo() {
return this.payNo;
}
UUID生成主键
UUID uuid = UUID.randomUUID();
String id=uuid.toString();
550E8400-E29B-11D4-A716-446655440000
一般去掉“-”
id=id.replace("-","");
int length=id.leagth();
System.out.println(length);//32
SSH自动生成主键+UUID生成主键
最新推荐文章于 2023-11-10 16:45:07 发布