-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 完成。