1. First create a new JPA project: If not, click Show All Wizards in the lower left corner. Click Finish after two times, without any action in the middle (point after the second next will appear connected to the database, regardless of the database) connected to the connection After clicking Finish 2. Open Myelipse Database Explorer view right-click New connection in the DB browser column: New ... Fill in the information: Remember to import the package, or you will get an error click Test Driver: Connect successfully to find the corresponding database table select the table that will generate the note model: right->JPA Reverse Engineering ... Select the newly-created JPA project (which is why you want to create a new JPA project, which will appear empty without a JPA project), click OK to select three and click Finish to always prompt the message in all steps, select No to ignore the conversion view to see the result: Generate model Success Finally, just copy and paste these model entity classes into your own real project. Note 1: If there is no primary key in the database table mapped by model, then two tables will be generated as follows: If there is a primary key, there is no exception Note 2: For many parties, MyEclipse is used to generate set of the management, if not meet the actual situation can be replaced by a list
To create a model entity class with annotations using MyEclipse