1. In eclipse Windows, select Preferences Enter driver definition in the query box
2. Click Add to select MySQL JDBC driver 5.1 in Name/type and click on the JAR list
3, download a mysql-connector-java-5.1.35.jar after putting it in the project's working directory after the 2 steps in the MySQL remove and then add the working directory under the jar package.
4. Then create a new MySQL connection in the data source Explorer
5. Enter the appropriate URL and account password in the connected MySQL and click Save Password and then click Test Connection to verify that the connection was successful.
6, select the item right-click to select Preferences in the Query box to enter project Facets Select the JPA selected below
7, set as follows
8. The right-click Project will have one more JPA tool option The second is to generate the database from the project, and the third option is to generate the entity class from the database
Generating entity classes in eclipse