hibernate tools反向生成实体类

工作中用到了hibernate tools反向生成,操作的时候各种不会,百度也都是另一种生成方式,所以记录一下我所用的方法以供参考。
1.右键工程,建一个source folder,命名为hibernate tools。

2.右键hibernate tools,选择new--others,选择



点击next,继续next



填写好,然后finish.


3.右键hibernate tools,选择new--others,选择



点击next,输入file name



继续next,选择刚才设置的session factory,点击refresh,然后就看到你的数据库里的表了




选择你要生成实体类和配置文件的表,点击inculde,然后finish。

4.找到左上方的这个按钮



选择hibernate code generation configurations
new一个configuration ,填写好




切换到exporters,勾选第一个和第二个



然后run,就生成了!







猜你喜欢

转载自i-conquer.iteye.com/blog/2102582