Automatically generate hibernate mapping files and entity classes with MyEclipse

Source: Internet
Author: User

Create a Web project, use Hibernate, create an entity class in a project it's too much trouble to waste time, now teach you how to use MyEclipse to automatically generate Hibernate mapping files and entities

Method/Step
  1. Create a database, create the appropriate table
  2. Click on the icon to select MyEclipse datebase Explorer
  3. Right-click an empty area, choose the New menu, follow the prompts to create a database connection, create the connection name you created, MYSQLDB is the database connection I created
  4. Select the project where you want to add the Hibernate image file right-click--->myeclipse-->add Hibernate capabilities
  5. Prompt, as prompted next, no need to change things
  6. When prompted, select the database connection name you just created, continue to the next step, and finally finish
  7. Just auto-generated things that have Hibernatesessionfactory.java and Hibernate.cfg.xml
  8. To the newly created database connection in MyEclipse datebase Explorer Select all tables, right-click--->hibernate Reverse enginnering Select Directory to hold the entity class that will be reversed to see if update is selected Hibernate configuration. If you do not check it yourself, next, you can set the ID growth method per table (assigned for the designation, in order to facilitate the system to make the decision ), and the resulting mapping file name considerations: the Class Name to specify the full package name assigned represents dignitaries for designation, in order to facilitate can be left blank to let the system decide
  9. Back to my Eclipse Enterprise view, all entity classes and configuration files have been generated

Automatically generate hibernate mapping files and entity classes with MyEclipse

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.