Hibernate not respecting MySQL auto_increment primary key field

前端 未结 5 2050
攒了一身酷
攒了一身酷 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:21

    I think GenerationType.AUTO is right as is

    Picks an appropriate strategy for the particular database.

    http://www.hibernate.org/hib_docs/ejb3-api/javax/persistence/GenerationType.html

    http://www.hibernate.org/hib_docs/reference/en/html/mapping.html

提交回复
热议问题