org.hibernate.HibernateException: identifier of an instance of 实体类的完整类路径 was altered from X to X.

org.hibernate.HibernateException: identifier of an instance of 实体类的完整类路径 was altered from X to X.

有一种可能是  上述“实体类的完整类路径”的类  中  主键 的类型与对应配置文件中的id类型不匹配。

 

例如我的错误示范:

org.hibernate.HibernateException: identifier of an instance of 实体类的完整类路径 was altered from X to X.org.hibernate.HibernateException: identifier of an instance of 实体类的完整类路径 was altered from X to X.