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

后端 未结 17 2391
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:34

    If you are using Spring MVC or Spring Boot try to avoid: @ModelAttribute("user") in one controoler, and in other controller model.addAttribute("user", userRepository.findOne(someId);

    This situation can produce such error.

提交回复
热议问题