IDEA 9 gives "cannot resolve column" on every entity, on IDEA 8 worked

Hello,

I've upgraded my project to IDEA 9 a couple weeks ago and I have just noticed that all my entities are red marked with this error: Cannot resolve column COLUMN_NAME

I checked on Data Sources window and my data source is correctly configured (as it was on IDEA 8) and up to date.

http://grab.by/grabs/08d3d78b111c7cc6c5da11f61b444540.png
As you can see on the screenshot one of my entities is open in the editor and the table that is associated with it is on the right side.

What I've to do to make IDEA 9 recognize the columns as IDEA 8 does?

6 comments
Comment actions Permalink

So, how do I configure a module to use the data source that is configured in Data Sources window using IDEA 9?

0
Comment actions Permalink

Works for me in version 9 without any problem.

Isn't there a quickfix to assign the DataSource?
(Place the caret on the red error, then press alt-enter or click on the light bulb.)

0
Comment actions Permalink

No. Quickfix gives me these options:

  • Convert to ThreadLocal
  • Converto to atomic
  • Inject Language
  • Inspection 'DataSource ORM Annotations Problem' options
    • Disable, edit or suppress inspection
0
Comment actions Permalink

Must have been dreaming that, then.
Check your Hibernate (or JPA) facet for the correct mapping to the data source.
(Project Structure -> Project Settings -> Modules -> (your module) -> (expand module in tree) -> Hibernate (or JSF) -> DataSources mapping

0
Comment actions Permalink

Thank you Stephen. This is the configuration I was looking for.

0
Comment actions Permalink

I'm having the same problem but this didn't fix it.

I have a hibernate facet added to my project, a data source set under DataSources Mapping for it under project settings.

And I'm even able to run SQL queries against the datasource and get results back, but IntelliJ insists that it cannot resolve the table name.

I notably cannot run HQL queries via some seemingly unrelated logging configuration error I'm also experiencing.

0

Please sign in to leave a comment.