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