![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hibernate
lujx_1024
这个作者很懒,什么都没留下…
展开
-
hibernate 报错 **** is not mapped 【from ****】
我在使用hibernate的Query对象查询数据列表时,遇到如下报错:ERROR [org.lujx.test.ManageCountry] - 查询信息失败 ,异常信息 :t_country is not mapped [from t_country]我的数据表结构如下:+------------+-------------+------+-----+---------+-----------...原创 2018-07-05 15:10:00 · 645 阅读 · 0 评论 -
HIbernate报错Batch update returned unexpected row count from update [0]; actual row count: 0; expected
使用hibernate报错如标题所示,在使用一对多关系映射时,使用测试方法测试save操作。出现这个错误的原因是数据库主键的定义是自增的方式,且数据库为空或者未创建,此时插入地数据带有主键id信息,便会执行update操作失败。解决方案:将插入地数据主键信息置为null,或者在执行操作之前导入数据库几条记录,保证相关联的数据库不为空的状态即可。相关配置文件如下User.hbm.xml<hib...原创 2018-07-10 11:10:12 · 1567 阅读 · 0 评论