Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA doesn't understand Hibernate Query Language (HQL)

When I work with HQL in IntelliJ IDEA it always highlights my Hibernate queries:

enter image description here

I know the way how I can disable that highlighting, that is already described here.

But I want to know is there a support of HQL in IntelliJ IDEA? Is there any way to use something like query auto-completion?

Maybe an option in settings or some plugin.

like image 911
DimaSan Avatar asked Oct 29 '16 22:10

DimaSan


2 Answers

Jetbrains / Intellij provides coding assistance, such as syntax highlighting, in string literals via Language Injection.

You can set the language to be injected via Settings > Editor > Language Injections.

In your case you need to set the language for org.hibernate.Session to Hibernate QL / HQL. I had to do the same thing for javax.persistance.EntityManager.

enter image description here

like image 62
Brett Y Avatar answered Oct 11 '22 09:10

Brett Y


Here is what for me resolve the same issue: Open in the IDEA Preferences (Settings)/Editor/Language Injections and under the list of languages find Session (org.hibernate). Under the column Language, it should be selected Hibernate QL. Double click on it and a list of operations will be displayed. Select the operations that you need. IDEA Settings

like image 38
Nensi Avatar answered Oct 11 '22 10:10

Nensi