springBoot jpa uuid生成策略

匿名 (未验证) 提交于 2019-12-02 21:53:52

实体类

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;     }  } 

  

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!