![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Hibernate
MaChuXiang
故不积跬步,无以至千里;不积小流,无以成江海。骐骥一跃,不能十步;驽马十驾,功在不舍。锲而舍之,朽木不折;锲而不舍,金石可镂。
展开
-
Hibernate之xxx.hbm.xml中集合
//此前,先写一个测试类,对三种不同的Set进行排序; public static void main(String[] args) { Set<String> set = new HashSet<String>(); //[dd, aa, bb, cc] 不排序 set = new TreeSet<String>(); //[aa, bb,...翻译 2018-05-05 14:50:53 · 250 阅读 · 0 评论 -
Hibernate之关联关系映射
一、一对多Dempartment { private int id; private String name; private Set<Employee> employees = new HashSet<Employee>(); }Employee { private int id; private String name; private Dempartm...翻译 2018-05-06 17:42:30 · 111 阅读 · 0 评论 -
Hibernate之基本的增删改查
一、java代码package pde.ams.user.dao; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.h...翻译 2018-04-29 15:37:16 · 122 阅读 · 0 评论 -
Hibernate之相关API
一、Hibernate 相关API1、Configuration 配置对象,对应着配置文件 configure(String) configure() 加载默认的主配置文件(hibernate.cfg.xml) addResource(String) ("包名/类名.hbm.xml") addClass(Class) (类名) ...翻译 2018-04-29 15:52:33 · 107 阅读 · 0 评论 -
Hibernate之hbm.xml映射文件
一、不同数据类型映射<!-- name是类名,table是对应的表名 --> <class name="cn.itcast.d_hbm_property.User" table="user"> <id name="id" type="int" column="id"> <gene翻译 2018-04-29 22:08:33 · 163 阅读 · 0 评论