Hibernate(一):安装hibernate插件到eclipse环境

  • 离线安装hibernate插件到eclipse

为什么需要安装hibernate插件到eclipse?在开发eclipse时,很多配置文件信息如果有了hibernate插件集成进来就会有自能提示,方便开发。

下载hibernate tools插件:

网址:http://hibernate.org/

找到

找到JBoos Tools down按钮点击进去

点击All Downloads链接,进入页面:

进入下载页面中,查看自己的eclipse版本(我自己的eclipse版本是 mars 5.2),到对应的JBoos Tools版本列表中下载JBoos Tools插件。但是,这里貌似不行,我点击4.3.1 Final进入下载列表中,并没有发现包含hibernate插件。所以我采用了下载这个版本:

因为其中包含了hibernate插件。点击 4.2.1 Final进入下载页面:

  • 安装Hibernate Tools插件到eclipse中

eclipse->help-> install software...->在弹出窗口中点击locale选择下载jbosstools-4.2.1.Final_2014-12-14_19-57-05-B217-updatesite-hibernatetools.zip一步一步安装即可。

  • 验证hibernate插件是否安装成功

新建一个项目Hibernate_01,在src下右键新建文件,在新建文件窗口中查看是否有:

配置自动提示hibernate配置文件

如果我们在编辑*.cfg.xml、*.hbm.xml、*.hre.xml文件无自动提示时,我们可以这么做,windows->preferences->xml节点先找到xml catalog:

点击"Add"按钮,弹出窗口:

在该窗口中切换Key type为URI,点击“File System...”按钮选择已经下载的hibernate开发包解压地址下对应的dtd文件:

原文地址:https://www.cnblogs.com/yy3b2007com/p/6709744.html