從表結構到項目實體類自動生成問題

-dbms-table-》---entity------java語言---------ssh架構

1.本實例說明使用資源:

  -----------開發軟件-myeclipse8.6+oracle11g

2.具體操作

 1)在myeclipse8.6面板中找到點擊》找到myeclipse database explorer 切換到DB Browser,右鍵new....  打開database driver 窗口,其中選擇對應的數據庫Driver template  ,填寫 driver name 、connection url 、username、password,添加driver jars  之後點擊test Driver按鈕測試通過。實例如圖:

 

 2) 新建web項目test,點擊項目右鍵找到myeclipse->add hibernate capabilities ->next->next->選擇DB driver (爲之前1)配置的database driver)    finish 至此hibernate project 完成。

3) 打開1)中配置的database driver open connection找到對應的數據庫實例,然後找到對應的table表,選擇需要反映射的表然後右鍵,選擇hibernate  Reverse engineering -----》在彈出的窗口中選擇  2) 中完成的hibernate project  ,選擇create pojo <>db table mapping information  ->選擇create a hibernate mapping file (*.hbm.xml) for each database table, 選擇 java data object (pojo <> db table)其中不選擇 create abstract class   ,之後就  next -》  next -》  finish  完成。

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章