1

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?

Doesn't Matter
  • 1,061
  • 3
  • 11
  • 29

3 Answers3

4

In IntelliJ idea go to

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

enter image description here

Avijit Barua
  • 2,950
  • 5
  • 14
  • 35
1

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

Eduard A
  • 370
  • 3
  • 9
0

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

KaijuDeluxe
  • 344
  • 1
  • 3
  • 13