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

hql, intellij-idea

Solution

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`.

Problem

When I work with HQL in IntelliJ IDEA, it always highlights my Hibernate queries: I know how I can disable that highlighting, that is already described here. But is there 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.

Original source