Configure JPA to let PostgreSQL generate the primary key value

后端 未结 5 1992
迷失自我
迷失自我 2020-12-01 07:45

So our project use PostgreSQL database and we use JPA for operating the database. We have created the entities from the database with automatic creator in Netbeans 7.1.2.

5条回答
  •  孤城傲影
    2020-12-01 08:15

    It seems you have to use the sequence generator like:

    @GeneratedValue(generator="YOUR_SEQ",strategy=GenerationType.SEQUENCE)
    

提交回复
热议问题