开发者

How to use reverse engineering in my eclipse

开发者 https://www.devze.com 2023-01-17 01:33 出处:网络
i am using MySql workbench and My Eclipse 8.6. and ma开发者_高级运维king a Hibernate-spring program. Is it possible to use reverse engineering feature in my eclipse with MySql workbench in so that DAO

i am using MySql workbench and My Eclipse 8.6. and ma开发者_高级运维king a Hibernate-spring program. Is it possible to use reverse engineering feature in my eclipse with MySql workbench in so that DAO and hbm files can be generate like Derby. How can i do this with MySql workbench. this is a URL of using reverse engineering in my eclipse. http://www.myeclipseide.com/documentation/quickstarts/hibernateandspring/


I'm not sure about MyEclipe, but in Eclipse 3.6 you can install the "Hibernate Tools" for eclipse. Steps then are - create schema and tables using MySQL Workbench - in Eclipse, create a new Database Connection (Database Perspective --> Data Source Explorer View --> Database Connections, right-click, new). Specify MySQL driver, username password, database etc - make sure that Eclipse is then connected to the database, and can do a mysql ping to it - In Eclipse, create a new "JPA" project. - right-click on the JPA Project, and go to "JPA Tools" --> Generate Entities from Tables. - in the wizard, you need to change the mechanism for auto-assigning ID's to entities being written to the database


That's so much easy in Myeclipse just follow the steps:

  1. Open Hibernate Perspective.
  2. In DBbrowser window create new connection for database.
  3. Fill the details about mysql connection as asked, and save it.
  4. Now in DBbrowser start the connection you create.
  5. Open the connection hierarchy and select your table for which you want to make hibernate class.
  6. Right click on table name and select "Hibernate Reverse Engineering".
  7. Fill the details and select desired location and finish.
  8. It will generate all classes you want.
0

精彩评论

暂无评论...
验证码 换一张
取 消