I have this Hibernate code:
Query q = session.createQuery(\"from MyTable where status = :status\");
It compiles and works fine..
IntelliJ is trying to validate your HQL query inside the string itself. To do this it needs to be configured to know about your hibernate configuration to ensure that a mapping exists for MyTable (it does at runtime, as you know - as it executes !).
Check out the hibernate config section in intelliJ for your project.
There is probably a way of turning it off if it is more hindrance than help.