Intellij IDEA: specify datasource for JPA validation

前端 未结 8 1547
无人共我
无人共我 2020-12-07 16:20

I have a Spring project for a small web app set up in Intellij IDEA.

It uses JPA on top of Hibernate for the persistence layer. The datasource (MySQL) is defined in

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 17:09

    First thing you have to add data source into your IDE. You can do it in the tab "Database" usually on right side. You can import this data source from your code. You should make sure that you hit button refresh tables. IDEA will load tables and use them for validation. Then you have to inside your JPA facet setup this data source.

提交回复
热议问题