Why does Hibernate query have compile error in IntelliJ?

后端 未结 4 1450
栀梦
栀梦 2020-12-09 15:54

I have this Hibernate code:

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

It compiles and works fine..

4条回答
  •  时光说笑
    2020-12-09 16:28

    Make sure that you have your Facets configured correctly. I was getting errors in my Spring Data JPA @Query annotations of "Can't resolve symbol" (just within IntelliJ IDEA; the code itself worked fine when I ran it) and I needed to go into Project Structure, Facets and add the JPA facet. (I assume if one is using Hibernate without JPA, then one would just add the Hibernate facet rather than the JPA facet.)

提交回复
热议问题