Missing sequence or table: hibernate_sequence

后端 未结 8 2326
礼貌的吻别
礼貌的吻别 2020-12-14 15:49

I am new to hibernate and postgres. Actually I am trying to map potgres database using Hibernate. This is my table stucture in postgresql

CREATE TABLE employ         


        
8条回答
  •  悲哀的现实
    2020-12-14 16:18

    You haven't posted the important bit: the Employee class.

    But my guess is that your Employee class is using @GeneratedValue() without specifying the sequence to use. So, Hibernate uses its default name: hibernate_sequence.

    You can supply a sequence name as part of the GeneratedValue annotation. eg.

    @GeneratedValue(strategy=SEQUENCE, generator="employee_id_seq")
    

提交回复
热议问题