Eclipse添加hibernate
来源:互联网 发布:比特彗星监听端口堵塞 编辑:程序博客网 时间:2024/05/18 18:42
创建web项目
创建一个web项目,FirstHibernatePro
创建数据库连接
创建一个数据库连接,这里使用的是Mysql数据库:window-->show View-->Data Source Explorer,然后在Database Connections右键 New,选择Mysql,然后去添加自己的数据库连接,并且添加详细的配置和加入相应的数据库驱动包
然后选择ok,开始测试自己的数据库连接,最后finish如果Database Source Exploer中出现了自己的数据库以及表则表明数据库连接创建完成,这里我的数据是test,表名是a,b
生成hibernate.cfg.xml文件和实体
在项目名称上面右键 new-->other然后选择Hibernate Configuration File(cfg.xml),然后next,
如果在这里忘了给Create a console configuration打钩,可以在为项目配置hibernate的时候选择Hibernate console configuration配置
配置好生成hibernate.cfg.xml文件后然后finish,src路径下就会出现了hibernate.cfg.xml文件
根据表生成类的实体
window-->Open Perspective-->other-->Hibernate;配置Hibernate Code Generation Configurations;新建一个Hibernate Code Configutaion
最后执行Run,项目的com.hibernate.model中就会出现和我们数据库中表相对应的实体和对应的xml
0 0
- Eclipse中添加Hibernate
- Eclipse添加hibernate
- Eclipse中添加hibernate插件
- Eclipse中添加struts hibernate spring
- eclipse 添加 hibernate *.hbm.xml自动提示
- eclipse上添加hibernate开发插件
- eclipse添加hibernate 插件和spring插件
- eclipse添加hibernate插件,在线安装方式
- Eclipse添加xml文件提示及Hibernate配置学习
- Eclipse中添加用户库Hibernate or Spring
- eclipse为hibernate.cfg.xml添加自动提示
- Eclipse中在web项目中添加hibernate
- 在eclipse中如何添加spring和hibernate
- 为web工程添加struts、hibernate和spring支持(eclipse)
- <Hibernate>Eclipse安装Hibernate插件
- Struts+Hibernate 实现添加
- hibernate添加索引
- spring + hibernate 添加用户
- 设计模式——策略模式
- ctex与texlive中的pdflatex与xelatex的区别
- fxiaoke 1--- 环境搭建以及常用ant命令及记录
- 序列式容器List之初始化及其几种(不支持随机)访问形式
- D语言下文件过滤copy的三种方式比较
- Eclipse添加hibernate
- 【杭电】[3785]寻找大富翁
- hadoop集群启动成功但live node为0
- Udp打洞和TCP打洞之我见
- POJ 2823 Sliding Window(单调队列||线段树)
- 看了这个就弄明白各种数据类型了
- Linux命令总结
- HDU 1575 Tr A(矩阵快速幂)
- [MFC]对CString::GetBufferSetLength方法的探究