📜  为我的实体生成 UUID id - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:29.434000             🧑  作者: Mango

代码示例1
@Id  
@Column(updatable = false, nullable = false, columnDefinition = "uuid DEFAULT uuid_generate_v4()")
@GeneratedValue(generator = "UUID")
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
private UUID id;