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不存在,那么就会报这个异常
Logo

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐