Intellij IDE 在实体中显示错误突出显示
Intellij IDE show error highlight in Entities
我在IntelliJ IDEA 2020.1.2(终极版)中打开了一个spring引导项目,我在实体中突出显示了许多错误,例如:
- 无法解析 table 'roles'
- Class 'RolesEntity' 应该有 [public, protected] 无参数构造函数
- 无法解析 table 'user_roles'
但是当我用旧版本打开我的项目时 IntelliJ IDEA 2019.3.3(社区版) 我没有看到这个问题。
IntelliJ IDEA 2020.1.2
IntelliJ IDEA 2019.3.3
这个问题的任何原因或任何修复?
尝试单击“文件”>“使缓存无效并重新启动”。这应该有帮助
试试这个
文件 -> 项目结构
在左侧窗格 select“方面”。如果没有列出 JPA,请单击“+”号并添加“JPA”
在同一对话框的底部,在“默认 JPA 提供程序”处,select - “休眠”,按“确定”
如果@Table注解出错,配置并选择数据源
Table select 的名称现在应该被识别为实体 class 名称
参考:GintsGints - Whosebug userName
在 IntelliJ IDEA 中转到
Setting->Inspections->JPA->Unresolved database reference in annotations->severity(恰到好处)->从error改为week warning
我在IntelliJ IDEA 2020.1.2(终极版)中打开了一个spring引导项目,我在实体中突出显示了许多错误,例如:
- 无法解析 table 'roles'
- Class 'RolesEntity' 应该有 [public, protected] 无参数构造函数
- 无法解析 table 'user_roles'
但是当我用旧版本打开我的项目时 IntelliJ IDEA 2019.3.3(社区版) 我没有看到这个问题。
IntelliJ IDEA 2020.1.2
IntelliJ IDEA 2019.3.3
这个问题的任何原因或任何修复?
尝试单击“文件”>“使缓存无效并重新启动”。这应该有帮助
试试这个
文件 -> 项目结构
在左侧窗格 select“方面”。如果没有列出 JPA,请单击“+”号并添加“JPA”
在同一对话框的底部,在“默认 JPA 提供程序”处,select - “休眠”,按“确定”
如果@Table注解出错,配置并选择数据源
Table select 的名称现在应该被识别为实体 class 名称
参考:GintsGints - Whosebug userName
在 IntelliJ IDEA 中转到
Setting->Inspections->JPA->Unresolved database reference in annotations->severity(恰到好处)->从error改为week warning