uuid

来源:互联网 发布:苹果软件商店图标 编辑:程序博客网 时间:2024/06/08 07:20
1.了解如何在一个类中通过注解实现uuid形式的主键

是用注解,在主键的上方的配置加入如下的两行配置
 @Id
 @GenericGenerator(name="systemUUID",strategy="uuid")(stategy=uuid不可乱命名)
 @GeneratedValue(generator="systemUUID")

 @Column(name = "actid", insertable = true, updatable = true, nullable = false)


注:ID字段必须为String型

0 0