Resolving Intellij IDE warnings in MyTableEntity.class with Spring Boot and Liquibase

已回答

Hello,

I am having an issue with my Intellij IDE where it is showing warnings in my MyTableEntity.class file.

These warnings appear in larger files and the quick fix suggests choosing a data source:

However, I am unsure which data source to choose as our Spring Boot application uses an H2 database locally (self hosted by the spring application) and a MySQL database in the cluster. We are using Liquibase to build the tables. Can someone please advise on what data source I should connect to in my IDE to resolve these warnings?




Thanks in advance.

0
正式评论

If your MySQL database in the cluster is used for development purposes, you may connect to it. The H2 DB can't be used since it is only available when your Spring Boot application is running. 

You may also safely disable this inspection as in fact the data source info is not required by JPA so it's just a warning:

You may find more info here: https://www.jetbrains.com.cn/help/idea/disabling-and-enabling-inspections.html

请先登录再写评论。