1, click Window->show view->db Browser, and then appear the following window
Right-key blank to select New, pop-up the following window:
First click on the Add Jars button, select the corresponding database JDBC driver (because I am using MySQL, so I chose the previous JDBC driver), after adding JDBC driver. Then select Driver template,driver name (optional), Connection URL, database username, database login password, then click Test Driver (test whether the database is connected successfully), and then click Finish. The Hibernate.cfg.xml configuration file is automatically generated in your project.
2, back to the DB browser window, double-click just to create a good data connection, that is good, find your database, and then find the table in the database, right-click Select Hibernate Reverse Engineering
Select the Project Java source folder (that is, Project/SRC), select Java pakcage (you can create it yourself), and then click Next, as shown
Id Generator Select Native, click Next, as shown in the picture
Click the database table that appears (I am here studentinfo), and then ID generator select native. Click Finish. Finally, the Java entity classes and the corresponding. hb.xml files appear in your project (I'm Studentinfo.java class and Studentinfo.hbn.xml files here). At this point, the Hibernate framework is used in MyEclipse, and the Java entity class and its corresponding configuration are created by reverse database, I wish you success.