![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hibernate
文章平均质量分 78
lingchenfeng
Java学习之路、
展开
-
hibernate.cfg.xml和.hbm.xml
hibernate数据持久化组件对象持久化,把数据保存在永久的存储介质中(数据库)OR/M(object relation mapping)对象关系映射。POJO类,就是标准的Java Bean。Hibernate就是一个可以自动的根据xml完成对象关系映射,并持久化到数据库的开源组件。Hibernate的底层也是有JDBC实现的。hibernate是通过xml文件的配置,对数据库的底层的方言原创 2010-01-28 20:01:00 · 1976 阅读 · 2 评论 -
自动建表
在配置好.cfg.xml和.hbm.xml后运行该application,能自动建表(自动建表方法不唯一)import org.hibernate.Session;import org.hibernate.SessionFactory;import org.hibernate.cfg.Configuration;import org.hibernate.tool.hbm2ddl.Schem原创 2010-01-29 11:49:00 · 449 阅读 · 0 评论 -
获得session单例
//获得session单例package app.common;import org.hibernate.Session;import org.hibernate.SessionFactory;import org.hibernate.cfg.Configuration;public class SessionConfig { private static SessionConfig原创 2010-01-30 15:03:00 · 639 阅读 · 0 评论