Hibernate not respecting MySQL auto_increment primary key field

前端 未结 5 2047
攒了一身酷
攒了一身酷 2020-12-15 18:56

I am trying to learn how Hibernate works, and I am running into an almost unacceptable learning curve. I can\'t see how to get Hibernate to respect the auto_increment policy

5条回答
  •  温柔的废话
    2020-12-15 19:31

    I believe you want GenerationType.IDENTITY. MySql does not use a table or sequence for generating the Id value.

提交回复
热议问题