When I work with HQL in IntelliJ IDEA it always highlights my Hibernate queries:
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.
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
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With