Hibernate 中出现 XXXX is not mapped 问题

来源:互联网 发布:美军在二战的地位知乎 编辑:程序博客网 时间:2024/06/04 19:55
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
原创粉丝点击