Hibernate Unknown integral data type for ids

前端 未结 1 1947
鱼传尺愫
鱼传尺愫 2021-01-17 11:44

I\'m starting with Hibernate and I have an error that I just can\'t figure out.

I have the following Classes:

@Entity
@Inheritance(strategy = Inherit         


        
相关标签:
1条回答
  • 2021-01-17 12:36

    If you want String to be database key you need to use UUID to automatically generate key. Something like this:

    @Id @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name="system-uuid", strategy = "uuid")
    private String myId;
    
    0 讨论(0)
提交回复
热议问题