[英]Intellij IDE show error highlight in Entities
I open a spring boot project in IntelliJ IDEA 2020.1.2 (Ultimate Edition) , and I hot many error highlight in entities, like:我在IntelliJ IDEA 2020.1.2 (Ultimate Edition)中打开了一个 spring 引导项目,并且在实体中出现了许多错误突出显示,例如:
But when I open my project in old version like IntelliJ IDEA 2019.3.3 (Community Edition) I don't see this problem.但是当我在IntelliJ IDEA 2019.3.3(社区版)等旧版本中打开我的项目时,我没有看到这个问题。
IntelliJ IDEA 2020.1.2 IntelliJ IDEA 2020.1.2
IntelliJ IDEA 2019.3.3 IntelliJ IDEA 2019.3.3
Any reason for this problem or any fix please?请问这个问题的任何原因或任何修复?
Try this one试试这个
File -> Project Structure文件 -> 项目结构
At left pane select "Facets".在左窗格 select “Facets”。 If there is no JPA listed, click "+" sign and add "JPA"
如果没有列出 JPA,请单击“+”号并添加“JPA”
At bottom of same dialog, at "Default JPA Provider", select - "Hibernate", press "OK"在同一对话框的底部,在“默认 JPA 提供程序”,select -“休眠”,按“确定”
If you have error at @Table annotation, configure and choose data source如果@Table annotation 有错误,请配置并选择数据源
Table name for select now should be recognized as entity class name select 的表名现在应被识别为实体 class 名称
Reference: GintsGints - stackOverFlow userName参考: GintsGints - stackOverFlow 用户名
Try to click File> Invalidate Cache & Restart.尝试单击文件> 使缓存无效并重新启动。 This should help
这应该有帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.