简体   繁体   中英

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:

  • Cannot resolve table 'roles'
  • Class 'RolesEntity' should have [public, protected] no-arg constructor
  • Cannot resolve table 'user_roles'

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 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?

In IntelliJ idea go to

Setting-> Inspections->JPA->Unresolved database reference in annotations-> severity(which is just right)-> change from error to week warnning.

在此处输入图像描述

Try this one


File -> Project Structure

At left pane select "Facets". If there is no JPA listed, click "+" sign and add "JPA"

At bottom of same dialog, at "Default JPA Provider", select - "Hibernate", press "OK"

If you have error at @Table annotation, configure and choose data source

Table name for select now should be recognized as entity class name


Reference: GintsGints - stackOverFlow userName

Try to click File> Invalidate Cache & Restart. This should help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM