Using Hibernate UUIDGenerator via annotations

后端 未结 8 692
无人共我
无人共我 2020-12-04 10:31

I\'m using my uuid as following:

@Id
@GeneratedValue(generator = \"uuid\")
@GenericGenerator(name = \"uuid\", strategy = \"uuid\")
@Column(name = \"uuid\", u         


        
8条回答
  •  忘掉有多难
    2020-12-04 11:04

    Unknown Id.generator: hibernate-uuid

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "org.hibernate.id.UUIDGenerator")
    @Column(name = "id", unique = true)
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    

提交回复
热议问题