1, click Window->show view->db Browser, and then appear the following window
Right-click on the blank to select New and pop up the following window:
First click the Add Jars button and select the JDBC driver for the database (because I'm using MySQL, so I chose the JDBC driver that I've already done), after I've added JDBC driver. Then select Driver template,driver name (optional), Connection URL, database user name, database login password, then click on test Driver (test if 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 create a good data connection, that is good, find your database, and then find the table in the database, right click to select Hibernate Reverse Engineering
Select the Project Java source folder (that is, Project/SRC), select Java pakcage (you can create it yourself), then click Next,
Id Generator Select Native, click Next,
Click on the database table that appears (I'm studentinfo here), then ID generator select native. Click Finish. Finally, the Java entity class and the corresponding. hb.xml file (I am the Studentinfo.java class and the Studentinfo.hbn.xml file) appear in your project. At this point, the Hibernate framework is used in MyEclipse, and the Java entity classes and their corresponding configurations are generated backwards through the database, and I wish you success.
MyEclipse hibernate generates Java entity classes in reverse database