Intellij Idea 14 + HIbernate查询 [英] Intellij Idea 14 + HIbernate query
本文介绍了Intellij Idea 14 + HIbernate查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
每当我编写这样的休眠查询时:
session.createQuery("from Table")
IntellijIdea 14将单词"from"标记为错误,并显示此描述:'from'意外".尽管项目可以成功编译(Maven),并且在生产中一切正常.
所以我的问题是:如何防止IDE对此类代码进行失败标记?
Whenever I write hibernate query such as this:
session.createQuery("from Table")
IntellijIdea 14 marks the word "from" as an error and show this description for it: "'from' unexpected". Although project compiles successfully (maven) and everything works fine in production.
So my question is: How to prevent IDE from fail-marking that kind of code?
推荐答案
您可以在编辑器中禁用突出显示问题的检查
You can disable an inspection for highlighted issue in the editor
- 将插入符号设置为单词
from
- 单击灯泡图标或按Alt + Enter以显示检查警报和建议列表.
- 悬停到要禁用的检查,然后单击右箭头按钮或仅按右箭头键.
- 在子菜单上,单击禁用检查名称"
- Set the caret at the word
from
- Click the bulb icon or press Alt+Enter to reveal the inspection alert and suggestion list.
- Hover to the inspection to be disabled, then click right arrow button or just press the right arrow key.
- On the submenu, click Disable "inspection name"
请参考 IntelliJ Doc 另一种方式
这篇关于Intellij Idea 14 + HIbernate查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文