异常提示org.springframework.orm.hibernate4.HibernateSystemException: identifier of an instance of com.User was altered from 2 to 1; nested exception is org.hibernate.HibernateException: identifier of an instance of com.User was altered from 2 to 1关联修改 报错。
只需要一句代码保存之前清理缓存
userDao.clear();
userDao.save();