springBoot jpa uuid生成策略
程序员文章站
2022-05-05 16:28:01
实体类 ......
实体类
import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; @Entity @Table(name = "Test") @GenericGenerator(name = "jpa-uuid", strategy = "uuid") public class Test{ @Id @GeneratedValue(generator = "jpa-uuid") @Column(length = 32) private String uid; private String name; public Test(){ } public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
上一篇: 幽默佳句,看了不白看!
下一篇: 为人师表说脏话