摘要: 1、一对一 (One to One) 共三种情况: 1.1 主键共享 1.2 外键共享 1.3 中间表关联1.1 code:@Entitypublic class article { @Id @GeneratedValue public Integer getArticleId() ... 阅读全文
posted @ 2014-05-03 16:29 Rhythmk 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 参考:http://docs.jboss.org/hibernate/annotations/3.4/reference/zh_cn/html_single/1、系统配置: 可以通过使用 mapping的 resource,于class 属性混合配置在创建SessionFactory 也可以通过代码... 阅读全文
posted @ 2014-05-03 15:20 Rhythmk 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 1、One To One 单相背景: 古代一个老婆 只能关联一个老公husband.javapackage com.rhythmk.model;public class husband { public Integer getHusbandId() { return husbandId; }... 阅读全文
posted @ 2014-05-03 00:17 Rhythmk 阅读(358) 评论(0) 推荐(0) 编辑
Rhythmk 个人笔记