Hibernate 中出现 XXXX is not mapped 问题

org.springframework.orm.hibernate4.HibernateQueryException: bookinfo is not mapped [delete from bookinfo where bid = 5]; nested exception is org.hibernate.hql.internal.ast.QuerySyntaxException: bookinfo is not mapped [delete from bookinfo where bid = 5]
    at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:175)
    at org.springframework.orm.hibernate4.HibernateTemplate.doExecute(HibernateTemplate.java:344)
    at org.springframework.orm.hibernate4.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:309)
    at org.springframework.orm.hibernate4.HibernateTemplate.bulkUpdate(HibernateTemplate.java:1096)
    以下省略

转载来源:http://blog.csdn.net/mr_li13/article/details/50286055

解决方案:
最开始百度上面各种搜索,都是说可能配置文件那里什么什么错误的啊,但是我检查了很多遍都找不出来配置文件错误,最终终于在:http://blog.csdn.net/jsj_126abc/article/details/6582074 这里找到了我需要的答案!!!!!!
就是说在HQL里面查询的from表名要是你映射的对应实体类的名称,而不是你数据库里面的表名。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值