hibernate常见错误
来源:互联网 发布:手机淘宝怎么做 编辑:程序博客网 时间:2024/06/03 20:43
1、Exception in thread "main" java.lang.ClassCastException: com.jiang.entity.UserBean_$$_javassist_0 cannot be cast to javassist.util.proxy.Proxy
外键设置懒加载:其中lazy="true",默认为true,只要自己主动设置为false即可;
2、ERROR: 无效的列类型: 16
Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not insert: [com.jiang.entity.UserBean]
16对应的boolean类型,所以错误原因是无法为boolean添加默认数据,只要在表上面添加dynamic-insert="true",或者在添加数据的时候主动添加上使用了boolean类型的数据即可
3、Exception in thread "main" org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.jiang.entity.UserBean#2]
主键值找不到,比如说我想修改主键为6L的这一条数据,但是6L不存在,那么就会报这个异常
外键设置懒加载:其中lazy="true",默认为true,只要自己主动设置为false即可;
2、ERROR: 无效的列类型: 16
Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not insert: [com.jiang.entity.UserBean]
16对应的boolean类型,所以错误原因是无法为boolean添加默认数据,只要在表上面添加dynamic-insert="true",或者在添加数据的时候主动添加上使用了boolean类型的数据即可
3、Exception in thread "main" org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.jiang.entity.UserBean#2]
主键值找不到,比如说我想修改主键为6L的这一条数据,但是6L不存在,那么就会报这个异常
阅读全文
0 0
- hibernate常见错误
- hibernate的常见错误!
- Hibernate常见错误
- Hibernate常见错误
- Hibernate常见错误
- Hibernate常见错误
- hibernate常见错误
- spring+hibernate常见错误
- hibernate常见错误
- hibernate常见错误
- hibernate常见错误
- hibernate常见错误汇总
- Hibernate常见错误
- Hibernate 常见错误
- Hibernate配置常见错误
- 常见hibernate错误
- hibernate常见错误汇总
- Hibernate 常见错误
- 关于JDBC连接mysql数据库
- 仅供自己参考第三方登录
- 【九度OJ】1010:A + B
- java中弹出对话框的应用
- 鼠标经过展开图片
- hibernate常见错误
- 数据库中间件2:关于连接异构数据库的性能问题
- hdu 1241
- leetcode 672. Bulb Switcher II
- 触宝科技2018校招笔试题
- Python学习-基础语法
- 【点的定位】Save the Students! UVALive
- 利用内存文件(共享内存)实现简单的数据库索引
- 守护进程