打开Eclipse 开发工具
菜单 help,选择 Eclipse marketplace
选择search 选项卡,搜索 hibernate 关键字
选择最新的安装版本(eclipse version)的Hibernate Tools点击install
点击confirm确认安装。
在Eclipse上安装hibernate Tool的方法:
1、选择Help-Software Updates,打开Available Software选项卡,然后单击Add Sites 分别输入JBoos的工具和Hibernate工具在线安装地址,然后选择安装Hibernate ToolsJboos 和Tools Development Release,如图所示:
2、等待安装成功,安装过程因要下载不少Jar包,视你的网络速度不同,需要的时间不同,安装完毕Eclipse将提示你重新启动,重启Eclipse安装完成。(注意:先安装Hibernate Tools成功后,再安装Jboos Tools Development Release)
1.下载hibernate tools插件
点击eclipse菜单Help,选择Install New Software...
点击Add,输入hibernate插件下载URL:http://download.jboss.org/jbosside/updates/stable
只选择其中的Hibernate Tool,点击Next。更新完成后重启eclipse。
2.新建一个java工程。这里的ojdbc14.jar是必须的。
3.创建hibernate配置文件、console配置文件
选中项目右键->new->other->hibernate->hibernate configuration file
点击Next,配置console文件:
4. 创建reverse文件。
选中项目右键->new->other->Hibernate->Hibernate Reverse Engineering file
5.反向工程创建POJO
在hibernate code generation configuration菜单中配置
然后点击RUN,生成相应的文件。一般来说自动生成的mapping文件需要修改后才能用