摘要:
实体:package uni.one2one.jointable;public class Husband { private int id; private String name; private Wife wife; public Husband() { } public Husband(int id, String name, Wife wife) { super(); this.id = id; this.name = name; this.wife = wife; } public int getId() { return id; } public void setId(... 阅读全文
posted @ 2011-07-23 10:19
focusJ
阅读(196)
评论(0)
推荐(0)
摘要:
实体:package uni.many2one.jointable;public class Parent { private int id; private String name; private Child child; public Parent() { } public Parent(int id, String name, Child child) { super(); this.id = id; this.name = name; this.child = child; } public int getId() { return id; } public void se... 阅读全文
posted @ 2011-07-23 10:17
focusJ
阅读(250)
评论(0)
推荐(0)
摘要:
实体:package uni.one2many.jointable;import java.util.HashSet;import java.util.Set;public class Emperor { private int id; private String name; private Set<Minister> ministers = new HashSet<Minister>(); public Emperor() { } public Emperor(int id, String name, Set<Minister> ministers) { 阅读全文
posted @ 2011-07-23 10:16
focusJ
阅读(235)
评论(0)
推荐(0)
摘要:
这里举了皇帝和大臣的例子,天子只有一个,而诸侯多的不胜计数。实体:package uni.one2many;import java.util.HashSet;import java.util.Set;public class Emperor { private int id; private String name; private Set<Minister> ministers = new HashSet<Minister>(); public Emperor() { } public Emperor(int id, String name, Set<Minis 阅读全文
posted @ 2011-07-23 10:13
focusJ
阅读(429)
评论(0)
推荐(0)
摘要:
这里举了一夫一妻的例子。实体:package uni.one2one;public class Husband { private int id; private String name; private Wife wife; public Husband() { } public Husband(int id, String name, Wife wife) { super(); this.id = id; this.name = name; this.wife = wife; } public int getId() { return id; } public void se... 阅读全文
posted @ 2011-07-23 10:08
focusJ
阅读(459)
评论(0)
推荐(0)
摘要:
在这里举了一个不太恰当的例子:双亲和孩子。当然举这个例子也有一定的道理,一个孩子至少有两个parent,但是例子只是例子,重点不是例子而是配置方法。下面我们看一下配置的详细步骤:实体:package uni.many2one;public class Child { private int id; private String name; public Child(int id, String name) { super(); this.id = id; this.name = name; } public Child() { } public int getId() { retur... 阅读全文
posted @ 2011-07-23 10:05
focusJ
阅读(485)
评论(0)
推荐(0)