IntelliJ - 对 Hibernate 查询进行持久化 QL 查询错误检查
我使用 hibernate 识别的类进行 hibernate 会话查询。此查询运行顺利,但以某种方式被 IntelliJ IDEA 识别为 Persistence QL 查询错误 - “无法解析符号”
我知道如何在 IntelliJ 检查选项中禁用 Persistence QL 查询错误检查,但是有没有办法以其他方式避免错误?
(我使用的是IntelliJ IDEA 9.0.3)
I have hibernate session query using a class recognized by hibernate. This query runs smoothly but is somehow recognized by IntelliJ IDEA as a Persistence QL Queries error - "Cant resolve symbol"
I know how to disable Persistence QL Queries error-check in IntelliJ inspection options, but is there a way to avoid the error in some other way?
(I'm using IntelliJ IDEA 9.0.3)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
IDEA 似乎无法识别您正在使用哪个或什么描述符。
检查项目结构 ->刻面->冬眠。您应该在描述符中找到了 cfg.xml 文件。如果您通过 Spring 会话工厂定义使用包扫描,您应该已经找到了会话工厂 bean。如果两者都不存在,则可以添加一个。
It seems IDEA doesn't recognize which or what Descriptor you are using.
Check Project Structure -> Facets -> Hibernate. You should have found a cfg.xml file in Descriptors. If you are using package scanning through spring session factory definition,you should have found a session factory bean. If neither of them exists,you may add one.
2- 如果您没有 cfg.xml 文件,则应添加新文件。
2- if you have not a cfg.xml file, you should add new one.
检查模型中是否有@Entity注释
Check if you have the @Entity annotation in your model