一个事物中主键被更新的问题

来源:互联网 发布:网络玄幻小说合集 编辑:程序博客网 时间:2024/04/29 05:08

Caused by: org.hibernate.HibernateException: identifier of an instance of

tv.huan.education.entity.Dictionary was altered from PT_01 to PT_02

在一个事务中更新了主键,而主键是不能被更新的

解决方案:创建一个实例对象,重新设值