Use myeclipse to create model entity classes with annotations, and myeclipsemodel

Source: Internet
Author: User

Use myeclipse to create model entity classes with annotations, and myeclipsemodel
1. create a JPA project first: Click Show All Wizards in the lower left corner. click "Next" twice and click "Finish". You do not need to perform any operations in the middle (after clicking "Next", you will see the Connection to the database, regardless of the database). For example, after clicking "FINISH", click "Finish. open the Myelipse Database Explorer view and right-click the DB Browser column to create a New connection: New... enter the information: Remember to import the package. Otherwise, an error will be reported. Click Test Driver: the connection is successful and the table of the corresponding database is displayed. Select the table that will generate the annotation model: Right-click> JPA Reverse Engineering... select the new JPA Project (this is why the JPA project is created, and it will be blank if there is no JPA project ), click "OK" and click "Next" to check all three items. Click "Finish". Information is always displayed in all steps. If yes, you can ignore the conversion view. The result is displayed: the model is successfully generated, you just need Copy and paste the model object class to your real project. Note 1: If the database table mapped by the model does not have a primary key, two tables will be generated as follows: if there is a primary key, there is no exception. Note 2: For multiple parties, myeclipse is managed by generating a Set. If not, it can be replaced with a List.

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.