Hibernate: How to fix “identifier of an instance altered from X to Y”?

后端 未结 17 2394
org.hibernate.HibernateException: identifier of an instance 
of org.cometd.hibernate.User altered from 12 to 3

in fact, my user table

17条回答
  •  春和景丽
    2020-12-01 07:41

    Are you changing the primary key value of a User object somewhere? You shouldn't do that. Check that your mapping for the primary key is correct.

    What does your mapping XML file or mapping annotations look like?

提交回复
热议问题