今天遇到的很恼火的问题identifier of an instance of jp.co.gecj.ito.model.TIipitomanage was altered from 2 to 1

来源:互联网 发布:大淘客和淘宝联盟 编辑:程序博客网 时间:2024/05/29 08:13

从上午到下午一直在解决这个问题,具体原因查Google有很多方法却都不适合,大概的意思是前后的类型不配合,现在引用的从 国外的论坛中发现的大概原因

 I just resolved this problem, the issue was that I had the wrong data type for my primary key in the entity's .hbm.xml file.

The underlying database table (SQL Server) has a primary key column of bigint. This column is also an identity field.

My original mapping config looked like this:



with this configuration I received the exception
identifier of an instance of ...[class name]... was altered from 1670012 to 1670012

I modified the mapping config to be:




and it works now.

原创粉丝点击