Prerequisites are:
- You have your Spring Boot project initialized correctly in IDEA
- JPA persistence.xml file or similar has been generated correctly
Then you have to do these things:
- Create a DataSource – here you will add a simple DataSource that will connect to your database. The setup should be intuitive – you only provide connection details and add DB drivers (IDEA can download them for you)
- Add JPA/Hibernate facet. You can do it like this or this.
- Now you should be able to generate entities using IDEA. What you want to do here is choose
Generate by Database Schema. The dialog will let you select the tables you want to use, the rest should be up to you.