IntelliJ IDEA的突出@Entity类名与"无法解析符号QUOT;在JP QL [英] IntelliJ IDEA highlights @Entity class names with "Cannot resolve symbol" in JP QL

查看:2159
本文介绍了IntelliJ IDEA的突出@Entity类名与"无法解析符号QUOT;在JP QL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IntelliJ IDEA的凸显与红色JP QL无法解析符号老大难@Entity类名是分散和埋没真正的问题。

IntelliJ IDEA highlights persistent @Entity class names with "Cannot resolve symbol" in red in JP QL which is distracting and buries real issues.

因此​​,举例来说,我在库中声明的查询:

So, for example, I declare a query in my repository:

private static final String READ_BY_CANDIDATE_KEY = "SELECT cr FROM Entity AS cr left join cr.relationship AS re left join fetch cr.relationship2 WHERE re.candidateKey=:ID";

..和实体强调的是,尽管实体是一个有效的类名,并有@Entity批注。当code实际运行,不存在任何问题。

.. and "Entity" is underlined, even though "Entity" is a valid class name, and has the @Entity annotation. When the code actually runs, there are no problems.

我想象某种配置的需要让IDE知道哪些类是有效的?该配置是怎么做的?

I imagine some sort of configuration is required to let the IDE know what classes are valid? How is that configuration done?

更新:我有一个JPA方面,但它并没有看到类中的注解。这似乎需要的persistence.xml或orm.xml中(这我的项目不使用)

Update: I do have a JPA facet, but it doesn't see the annotated classes. It seems to require a persistence.xml or orm.xml (which my project does not use)

推荐答案

好像你没有选择的方面配置的默认JPA提供者。根据您所使用的提供商,挑选一个从列表中。可用选项包括的EclipseLink,休眠,OpenJPA中,TopLink的

Seems like you have not selected the default JPA provider in facet configuration. Depending upon which provider you are using, pick one from the list. Available options are EclipseLink, Hibernate, OpenJPA, TopLink

这篇关于IntelliJ IDEA的突出@Entity类名与"无法解析符号QUOT;在JP QL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆