常见Hibernate异常org.hibernate.TypeMismatchException: Provided id of the wrong type for class:
严重: Servlet.service() for servlet action threw exception
org.hibernate.TypeMismatchException: Provided id of the wrong type for class com.uitest.domain.Product. Expected: class java.lang.Long, got class java.lang.String
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:109)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:842)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:835)
at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:531)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.get(HibernateTemplate.java:525)
通常这种错误是由于ID类型不对引起的!!!
解决的办法:检查下ID的类型,把页面串回来的id值由string没转换成Long类型,再进行删除,就可以了。
分享到:
相关推荐
Based on the given document information, we can derive several key points related to the Programming Environments Manual for 32-Bit Implementations of the PowerPC™ Architecture. ### Title: ...
take advantage of protocols for which Sun does not provide out-of-the-box support. You'll find support for NNTP (Network News Transport Protocol) [newsgroups], S/MIME (Secure Multipurpose Internet ...
The Student class has private member variables for the student's information, including student ID, name, gender, birthday, grade, class, department, and major. The class has multiple constructors, ...
"The quality of the images provided is exemplary!...The book can be used as a learning tool for residents and as a great reference for fellows and practicing radiologists" - The Bookshelf February ...
Please refer to the Readme.htm file provided with the SMDK for .NET for the latest information on updating your terminal for use with the class libraries and for information on how to deploy your ...
This paper shows a proposal for Type-...provided and used for computing the centroid of an Interval Type-2 fuzzy set through a mapping of its membership function, instead of its universe of discourse.
Source code for all the examples provided, and for the GLUT library itself, are available for downloading via the Internet. Intended for C programmers familiar with the Xlib and/or Motif programming ...
一幅超清晰的地图! 程序员也应该有自己的爱好,喜欢的可以看看!
For solution curves defined by ordinary differential equations, special routines are provided that evaluate the Taylor coefficient vectors and their Jacobians with respect to the current state vector....
Across the chapters, different authors have addressed a variety of specific questions and provided their perspectives, but all explore the main themes described above to provide an overarching ...
For vehicle-to-grid (V2G) frequency regulation services, we propose an aggregator that makes efficient use of the distributed power of electric vehicles to produce the desired grid-scale power. The ...
This document contains the solutions to review questions and problems for the 5th edition of Computer Networking: A Top-Down Approach by Jim Kurose and Keith Ross. These solutions are being made ...
This book introduces the problems facing Internet of Things developers and explores current technologies and techniques to help you manage, mine, and make sense of the data being collected through the...
These lecture notes grew out of class notes provided for the students in CSCI 104 (“Data Structures and Object-Oriented Design”) at the University of Southern California in Fall of 2013.
(the last one can be overridden for the implementation of new alignment rules). - ADD: The property TFlexPanel.GridControl moved to the public section and is now available for writing (during the ...