views:

123

answers:

1

I have this Hibernate code:

Query q = session.createQuery("from MyTable where status = :status");

It compiles and works fine..

But in IntelliJ I get this error reported:

Can't resolve expression, Can't resolve symbol 'MyTable'

Why is IntelliJ complaining??

+1  A: 

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.

Michael Neale
Thanks. It was actually a setting under Java EE issues \ Persistence QL Problems. Turned it off and I was good.
Marcus

related questions