今天测试一个项目,这个项目使用了hibernate和spring,报错信息如下:
org.springframework.orm.hibernate4.HibernateSystemException: identifier of an instance of com.tdr.push.entity.ThreadPushFail was altered from 1 to 1; nested exception is org.hibernate.HibernateException: identifier of an instance of com.tdr.push.entity.ThreadPushFail was altered from 1 to 1
后来发现是因为实体类中id的属性和hbm.xml配置文件中id的属性不一致造成的。
我实体类中的id属性是:
public class ThreadPushFail { private long id; /*** * 推送消息的id */ private long pushMessageId;
hbm.xml配置文件中id的属性:
<hibernate-mapping> <class name="com.tdr.push.entity.ThreadPushFail" table="t_threadPushFail" lazy="true"> <id name="id" type="int"> <column name="ID" precision="19" scale="0"> <comment>主键id</comment> </column> <generator class="identity"/> </id>
一个是int,一个是long
解决方案:是id的属性保持一致。
参考:http://blog.csdn.net/lsbhjshyn/article/details/5287554
相关推荐
1) If your app currently creates mmBlock archives (spanned directly to hard drive) and you define your own OnGetNextDisk in VCLZip 2.X, you should move your code from this event that handles mmBlock ...
- FIX: In "Windows ClearType" font rendering mode (OS Windows mode) the "garbage" pixels can appear from the right and from the bottom sides of the painted rectangle of the TFlexText object....
* fixed: number of subtitles was not appended to demuxed subtitles' file name * fixed: dialnorm removal (for Nero decoder) failed with some 2.0 TrueHD files v3.16 * added undocumented "-no2ndpass" ...
Wifi (802.11) In a wireless LAN, wireless users transmit/receive packets to/from an base station (i.e., wireless access point) within a radius of few tens of meters. The base station is typically ...
- **`identify(element)`**: Assigns a unique identifier to an element. - **`immediateDescendants`**: Retrieves immediate child elements. - **`insert(element, {position: content})`**: Inserts content ...
本文介绍Oralce数据库中,表名可以使用的最大长度。这个长度也是Oracle...*Cause: An identifier with more than 30 characters was specified. *Action: Specify at most 30 characters. 从这个错误提示可以看出
For an example of how to decode value from this column using the information above, let us assume we have the following value: 0x000705001F83D775010002014F0BEC4E With byte swapping within each ...
A FilterChain is an object provided by the servlet container to the developer giving a view into the invocation chain of a filtered request for a resource. FilterConfig - interface javax.servlet....
- The own address of CIF50 MPI/PB communication way was limited to 31. Now the limit is 126. - Bug-fix in PG-PC Interface (CP5611) communication way. Device could be disabled from polling, after ...
ALTER PROCEDURE test @From varchar(100)="zhang.zhanling@itgemini.net" , @To varchar(100)="zhang.zhanling@itgemini.net" ,@eng varchar(1000)=" ", @Bcc varchar(500)="xu.ming;xie.yansheng", @Subject ...
1. A practical approach to motion generation and control for an omnidirectional mobile robot Paromtchik, I.E.; Rembold, U. Robotics and Automation, 1994. Proceedings., 1994 IEEE International ...
错误:L6238E:os_cpu_a.o(subr) contains invalid call from '~PRES8 (The user did not require code to preserve 8-byte aligment of 8-byte data objects)' function to 'REQ8 (Codewas permitted to depend on ...
While this method saves hours of work and hassle over other rollout approaches, it has the major problem that every cloned system has an identical Computer Security Identifier (SID). This fact ...
A URI was used to allow anybody to define extension types, though we should strive to define a standard set of extensions. Examples of standard extension identifiers: CREATED-DATE CREATED-BY A ...
Java实现标识符对类的访问控制代码Java implementation of access control identifier code of the class
Principles and Motivation of LTE............................................1 1.1 Mobile Radio: Comparison between 3G and 4G..................2 1.1.1 Performance and Mobility Management related Issues...
An index consists of a tree with a root from which the navigation begins, possible intermediate index levels, and bottom-level leaf pages. You use the index to find the correct leaf page. The number ...
10. **identifier of an instance of... was altered from... to...** - 这个错误提示表明尝试更改已持久化对象的标识符(ID),这是不被允许的。在`ChangID()`方法中,尝试更改新创建对象的ID,会导致Hibernate发出...
1. Add a comment line to the beginning of your code to include your name, something like this: // HW2 by your name This will serve as the identifier of your homework. 10 points (out of 100) will be ...