org.hibernate.TypeMismatchException: Provided id of the wrong type for class cn.itcast.entity.User. Expected: class java.lang.String, got class java.lang.Integer at org.hibernate.event.internal.Defau
出现org.hibernate.TypeMismatchException: Provided id of the wrong type for class cn.itcast.entity.User. Expected: class java.lang.String, got class java.lang.Integer at org.hibernate.event.internal.DefaultLoadEventListener.checkIdClass(DefaultLoadEventListen
这样的错误,可能是bean中的数据类型和hbm.xml中指定的主键生成策略不一致。
比如我在bean中,将uid写出字符串,而在hbm.xml中使用的是<generator class="native"/>这样就报错了。
org.hibernate.TypeMismatchException: Provided id of the wrong type for class cn.itcast.entity.User. Expected: class java.lang.String, got class java.lang.Integer at org.hibernate.event.internal.Defau的更多相关文章
- TypeMismatchException: Provided id of the wrong type for class zhongfucheng.user.entity.User.
今天在使用SSH框架做项目的时候出现了这个错误,找了我非常非常多的时间!!!!!!! Struts Problem Report Struts has detected an unhandled ex ...
- org.hibernate.TypeMismatchException: Provided id of the wrong type for class *** Expected ***
今天上生产发现warn日志有异常,就查看了下: 2018-12-05 10:05:05.666 [pool-4-thread-1] ERROR org.springframework.batch.co ...
- Provided id of the wrong type for class pojo.Books. Expected: class java.lang.Integer, got class java.lang.Long
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please ...
- 报错HTTP Status 500 - HHH000142: Javassist Enhancement failed: cn.itcast.entity.Customer; nested exception is org.hibernate.HibernateException: HHH000142: Javassist Enhancement failed: cn.itcast.entity.
报错 type Exception report message HHH000142: Javassist Enhancement failed: cn.itcast.entity.Customer; ...
- 报错HTTP Status 500 - The given object has a null identifier: cn.itcast.entity.Customer; nested exception is org.hibernate.TransientObjectException: The given object has a null identifier:
在使用模型驱动封装的时候,要保证表单中name属性名和类中属性名一致,否则将会报错如下: HTTP Status 500 - The given object has a null identifie ...
- 报错:org.hibernate.AssertionFailure: null id in com.tt.hibernate.entities.News entry (don't flush the Session after an exception occurs)
在使用hibernate创建数据库的表格时,出现了如下报错: 十二月 28, 2016 10:17:02 上午 org.hibernate.tool.hbm2ddl.SchemaExport perf ...
- Hibernate注解映射sequence时出现无序增长问题+hibernate 映射 oracle ID自动增长:
Hibernate注解映射sequence时出现无序增长问题+hibernate 映射 oracle ID自动增长: 通过Hibernate注解的方式映射oracel数据库的sequence主键生成器 ...
- org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.String
org.hibernate.id.IdentifierGenerationException: Unknown integral data type for ids : java.lang.Strin ...
- org.hibernate.AssertionFailure: null id in xxx.xx.xx的问题
今日在开发时遇到一个比较奇怪的问题,保存时报这个异常: org.hibernate.AssertionFailure: null id in com.aa.TShoucang null id,这个是什 ...
随机推荐
- 巨蟒python全栈开发django4:url反向解析图解&&模板渲染2
注意:前端有aaa变量,后端没有aaa变量,存在p标签,但是显示不出来 有p标签,我们可以指定默认值,在没有其他内容的时候 过滤器有60多种,有点多,用到的时候再记和查 结果: 显示是acd 看长度 ...
- JavaScript数据结构与算法-集合练习
集合的实现 function Set () { this.dataStore = []; this.add = add; this.remove = remove; this.size = size; ...
- Android系统移植与调试之------->如何修改Android设备存储盘符名称与Android设备的型号
一.修改Android设备存储盘符名称 (注:TBDG1073为我的项目名称) 1.修改device/other/TBDG1073/system.prop 文件 2.修改ro.media.patiti ...
- scrapy+mongodb报错 TypeError: name must be an instance of str
经过各种排查,最后找到原因,在settings文件中配置文件大小写写错了,在pipelines中 mongo_db=crawler.settings.get('MONGODB_DB'),get 获取的 ...
- mapdb与Redis区别:
Redis也能完全相同的工作,但必竟其独立于JVM之外通过Socket交互,能达到10万次/秒就很不了不起了 mapdb可直接嵌入到JVM运行空间,运行效率是Redis没法比的,单线程能达到 30万次 ...
- LATEX教程(二)
插入图片 \documentclass{article} \usepackage{graphicx} \usepackage{Ctex} \title{插入图片} \author{yif} \begi ...
- 【转】web.xml中load-on-startup的作用
http://www.blogjava.net/xzclog/archive/2011/09/29/359789.html 如下一段配置,熟悉DWR的再熟悉不过了:<servlet> ...
- Android 结束进程的方法forceStopPackage
ActivityManager sd = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); Method method = Clas ...
- windows 2008 负载均衡(NLB) 问题汇总
1. 主机不可访问 修改host文件. 将主机名与IP做相应的映射. 它们应该是使用主机名来访问对应的服务器. host文件路径: C:\Windows\System32\drivers\etc 19 ...
- 前端 初级篇(HTML)
HTML 概述: HTML是英文Hyper Text Mark-up Language(超文本标记语言)的缩写,他是一种制作万维网页面标准语言(标记).相当于定义统一的一套规则,大家都来遵守他,这样就 ...