springboot jpa 使用uuid生成id

直接上代码记录备忘 :

@Entity
@Table(name="sys_f")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@NamedQuery(name="SysF.findAll", query="SELECT s FROM SysF s")
public class SysF implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(name="F_ID")
    private String fId;
 

你可能感兴趣的:(springboot,jpa)