我的休眠映射文件存在,找不到映射的可能原因是什么?
我动态生成了我的 hbms。现在,当我尝试在 Eclipse 中使用 HQL 编辑器时,出现以下错误:
Hibernate 动态 SQL 窗口: HQL 有效,但没有生成 SQL。您的配置很可能没有定义任何映射。
Hibernate查询结果窗口: org.hibernate.hql.ast.QuerySyntaxException:系统未映射[来自系统]。
我的 hql 为:
来自 com.kevin.hibernate.Address
I dynamically generated my hbms. Now when I attempt to use the HQL Editor in Eclipse, I'm getting the following error:
Hibernate Dynamic SQL Window:
HQL was valid, but no SQL generated. Your configuration most likely does not have any mappings defined.
Hibernate Query Result Window:
org.hibernate.hql.ast.QuerySyntaxException: system is not mapped [from system].
My hql reads:
from com.kevin.hibernate.Address
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是如何创建Hibernate 控制台配置的?您是否声明了
hibernate.cfg.xml
?如果是,它是否列出映射?您在错误视图中得到任何有用的提示吗?也许遵循 3.3 部分的步骤。创建 Hibernate 控制台配置将会有所帮助。
参考资料
How did you create your Hibernate Console Configuration? Did you declare a
hibernate.cfg.xml
? If yes, does it list the mappings? Do you get any useful hint in the Error View?Maybe following the steps of the section 3.3. Creating a Hibernate Console configuration will help.
References