MyEclipse hibernate generates Java entity classes in reverse database

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.